pub struct Client { /* private fields */ }Expand description
Endpoint interface to Discord Bot List API.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new_with_client(client: ReqwestClient, token: String) -> Self
pub fn new_with_client(client: ReqwestClient, token: String) -> Self
Constructs a new Client with a reqwest client.
Sourcepub async fn search(&self, filter: &Filter) -> Result<Listing, Error>
pub async fn search(&self, filter: &Filter) -> Result<Listing, Error>
Search for bots.
§Example
use dbl::types::Filter;
let filter = Filter::new().search("lib:serenity foobar");Sourcepub async fn update_stats<T>(
&self,
bot: T,
stats: ShardStats,
) -> Result<(), Error>
pub async fn update_stats<T>( &self, bot: T, stats: ShardStats, ) -> Result<(), Error>
Update the stats of a bot.
§Example
use dbl::types::ShardStats;
let new_stats = ShardStats::Cumulative {
server_count: 1234,
shard_count: None,
};Sourcepub async fn votes<T>(&self, bot: T) -> Result<Vec<User>, Error>
pub async fn votes<T>(&self, bot: T) -> Result<Vec<User>, Error>
Get the last 1000 votes for a bot.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more