Struct telexide::client::ClientBuilder[][src]

pub struct ClientBuilder { /* fields omitted */ }

A builder for the Client object to make customisation easier

Implementations

impl ClientBuilder[src]

pub fn new() -> Self[src]

Creates a bare builder

pub fn set_webhook(&mut self, webhook: &WebhookOptions) -> &mut Self[src]

sets the webhook url for the Client to listen to

pub fn set_framework(&mut self, framework: Arc<Framework>) -> &mut Self[src]

Sets the framework for your bot to use, please use the create_framework macro for creating it

pub fn set_token(&mut self, token: &str) -> &mut Self[src]

Sets the token to be used in authorizing the API requests of your bot

pub fn set_hyper_client(
    &mut self,
    client: Client<HttpsConnector<HttpConnector>>
) -> &mut Self
[src]

Sets the custom hyper client for the APIClient to use

pub fn set_api_client(&mut self, client: Arc<Box<dyn API + Send>>) -> &mut Self[src]

Sets the custom API client

pub fn set_allowed_updates(&mut self, allowed: Vec<UpdateType>) -> &mut Self[src]

Set the list of update types you want your update handlers to handle

pub fn add_allowed_updates(&mut self, allowed: UpdateType) -> &mut Self[src]

Add an update type to the list of update types you want your update handlers to handle

pub fn remove_allowed_updates(&mut self, denied: &UpdateType) -> &mut Self[src]

Remove an update type from the list of update types you want your update handlers to handle

pub fn add_handler_func(&mut self, handler: EventHandlerFunc) -> &mut Self[src]

Adds an EventHandlerFunc function for handling incoming updates

pub fn add_raw_handler_func(
    &mut self,
    handler: RawEventHandlerFunc
) -> &mut Self
[src]

Adds an RawEventHandlerFunc function for handling incoming updates

pub fn build(&mut self) -> Client[src]

Creates the Client object from the settings set in the ClientBuilder object

Auto Trait Implementations

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, 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> UnsafeAny for T where
    T: Any