pub struct ClientBuilder { /* private fields */ }Expand description
A builder for the Client object to make customisation easier
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn set_webhook(&mut self, webhook: &WebhookOptions) -> &mut Self
pub fn set_webhook(&mut self, webhook: &WebhookOptions) -> &mut Self
sets the webhook url for the Client to listen to
Sourcepub fn set_framework(&mut self, framework: Arc<Framework>) -> &mut Self
pub fn set_framework(&mut self, framework: Arc<Framework>) -> &mut Self
Sets the framework for your bot to use, please use the
create_framework macro for creating it
Sourcepub fn set_token(&mut self, token: &str) -> &mut Self
pub fn set_token(&mut self, token: &str) -> &mut Self
Sets the token to be used in authorizing the API requests of your bot
Sourcepub fn set_hyper_client(
&mut self,
client: Client<HttpsConnector<HttpConnector>>,
) -> &mut Self
pub fn set_hyper_client( &mut self, client: Client<HttpsConnector<HttpConnector>>, ) -> &mut Self
Sets the custom hyper client for the APIClient to use
Sourcepub fn set_api_client(&mut self, client: Arc<Box<dyn API + Send>>) -> &mut Self
pub fn set_api_client(&mut self, client: Arc<Box<dyn API + Send>>) -> &mut Self
Sets the custom API client
Sourcepub fn set_allowed_updates(&mut self, allowed: Vec<UpdateType>) -> &mut Self
pub fn set_allowed_updates(&mut self, allowed: Vec<UpdateType>) -> &mut Self
Set the list of update types you want your update handlers to handle
Sourcepub fn add_allowed_updates(&mut self, allowed: UpdateType) -> &mut Self
pub fn add_allowed_updates(&mut self, allowed: UpdateType) -> &mut Self
Add an update type to the list of update types you want your update handlers to handle
Sourcepub fn remove_allowed_updates(&mut self, denied: &UpdateType) -> &mut Self
pub fn remove_allowed_updates(&mut self, denied: &UpdateType) -> &mut Self
Remove an update type from the list of update types you want your update handlers to handle
Sourcepub fn add_handler_func(&mut self, handler: EventHandlerFunc) -> &mut Self
pub fn add_handler_func(&mut self, handler: EventHandlerFunc) -> &mut Self
Adds an EventHandlerFunc function for handling incoming updates
Sourcepub fn add_raw_handler_func(
&mut self,
handler: RawEventHandlerFunc,
) -> &mut Self
pub fn add_raw_handler_func( &mut self, handler: RawEventHandlerFunc, ) -> &mut Self
Adds an RawEventHandlerFunc function for handling incoming updates
Sourcepub fn build(&mut self) -> Client
pub fn build(&mut self) -> Client
Creates the Client object from the settings set in the
ClientBuilder object