[][src]Struct dbl::Client

pub struct Client { /* fields omitted */ }

Endpoint interface to Discord Bot List API.

Methods

impl Client[src]

pub fn new(token: String) -> Result<Self, Error>[src]

Constructs a new Client.

pub fn new_with(client: Arc<ReqwestClient>, token: String) -> Self[src]

Constructs a new Client with a reqwest client.

pub fn get<T>(&self, bot: T) -> impl Future<Item = Bot, Error = Error> where
    T: Into<BotId>, 
[src]

Get information about a specific bot.

pub fn search(
    &self,
    filter: &Filter
) -> impl Future<Item = Listing, Error = Error>
[src]

Search for bots.

Example

use dbl::types::Filter;

let filter = Filter::new().search("lib:serenity foobar");

pub fn stats<T>(&self, bot: T) -> impl Future<Item = Stats, Error = Error> where
    T: Into<BotId>, 
[src]

Get the stats of a bot.

pub fn update_stats<T>(
    &self,
    bot: T,
    stats: ShardStats
) -> impl Future<Item = (), Error = 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 fn votes<T>(&self, bot: T) -> impl Future<Item = Vec<User>, Error = Error> where
    T: Into<BotId>, 
[src]

Get the last 1000 votes for a bot.

pub fn has_voted<T, U>(
    &self,
    bot: T,
    user: U
) -> impl Future<Item = bool, Error = Error> where
    T: Into<BotId>,
    U: Into<UserId>, 
[src]

Check if a user has voted for a bot in the past 24 hours.

pub fn user<T>(
    &self,
    user: T
) -> impl Future<Item = DetailedUser, Error = Error> where
    T: Into<UserId>, 
[src]

Get information about a user.

Auto Trait Implementations

impl Send for Client

impl Sync for Client

Blanket Implementations

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

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

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.

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

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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