Struct telexide::client::ClientBuilder
source · 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: impl ToString) -> &mut Self
pub fn set_token(&mut self, token: impl ToString) -> &mut Self
Sets the token to be used in authorizing the API requests of your bot
sourcepub fn set_hyper_client(&mut self, client: TlsClient) -> &mut Self
pub fn set_hyper_client(&mut self, client: TlsClient) -> &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
An empty list means all updates except ChatMember
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
An empty list means all updates except ChatMember
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
Note: An empty list means all updates except ChatMember
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