[][src]Struct dbl::Client

pub struct Client { /* fields omitted */ }

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]

Get information about a specific bot.

pub async fn search<'_, '_>(
    &'_ self,
    filter: &'_ Filter
) -> Result<Listing, Error>
[src]

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]

Get the stats of a bot.

pub async fn update_stats<T, '_>(
    &'_ self,
    bot: T,
    stats: ShardStats
) -> Result<(), Error> where
    T: Into<BotId>, 
[src]

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]

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]

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]

Get information about a user.

Trait Implementations

impl Clone for Client[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.