[−][src]Struct dbl::Client
Endpoint interface to Discord Bot List API.
Implementations
impl Client[src]
pub fn new(token: String) -> Result<Self, Error>[src]
Constructs a new Client.
pub fn new_with_client(client: ReqwestClient, token: String) -> Self[src]
Constructs a new Client with a reqwest client.
pub async fn get<T, '_>(&'_ self, bot: T) -> Result<Bot, Error> where
T: Into<BotId>, [src]
T: Into<BotId>,
Get information about a specific bot.
pub async fn search<'_, '_>(
&'_ self,
filter: &'_ Filter
) -> Result<Listing, Error>[src]
&'_ self,
filter: &'_ Filter
) -> Result<Listing, Error>
Search for bots.
Example
use dbl::types::Filter; let filter = Filter::new().search("lib:serenity foobar");
pub async fn stats<T, '_>(&'_ self, bot: T) -> Result<Stats, Error> where
T: Into<BotId>, [src]
T: Into<BotId>,
Get the stats of a bot.
pub async fn update_stats<T, '_>(
&'_ self,
bot: T,
stats: ShardStats
) -> Result<(), Error> where
T: Into<BotId>, [src]
&'_ self,
bot: T,
stats: ShardStats
) -> Result<(), Error> where
T: Into<BotId>,
Update the stats of a bot.
Example
use dbl::types::ShardStats; let new_stats = ShardStats::Cumulative { server_count: 1234, shard_count: None, };
pub async fn votes<T, '_>(&'_ self, bot: T) -> Result<Vec<User>, Error> where
T: Into<BotId>, [src]
T: Into<BotId>,
Get the last 1000 votes for a bot.
pub async fn has_voted<T, U, '_>(
&'_ self,
bot: T,
user: U
) -> Result<bool, Error> where
T: Into<BotId>,
U: Into<UserId>, [src]
&'_ self,
bot: T,
user: U
) -> Result<bool, Error> where
T: Into<BotId>,
U: Into<UserId>,
Check if a user has voted for a bot in the past 24 hours.
pub async fn user<T, '_>(&'_ self, user: T) -> Result<DetailedUser, Error> where
T: Into<UserId>, [src]
T: Into<UserId>,
Get information about a user.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
fn instrument(self, span: Span) -> Instrumented<Self>[src]
fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,