[−][src]Struct telexide::client::ClientBuilder
A builder for the Client
object to make customisation easier
Methods
impl ClientBuilder
[src]
pub fn new() -> Self
[src]
Creates a bare builder
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]
&mut self,
client: Client<HttpsConnector<HttpConnector>>
) -> &mut Self
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: fn(_: Context, _: Update) -> Pin<Box<dyn Future<Output = ()> + Send>>
) -> &mut Self
[src]
&mut self,
handler: fn(_: Context, _: Update) -> Pin<Box<dyn Future<Output = ()> + Send>>
) -> &mut Self
Adds an [EventHandlerFunc
] function for handling incoming updates
pub fn add_raw_handler_func(
&mut self,
handler: fn(_: Context, _: RawUpdate) -> Pin<Box<dyn Future<Output = ()> + Send>>
) -> &mut Self
[src]
&mut self,
handler: fn(_: Context, _: RawUpdate) -> Pin<Box<dyn Future<Output = ()> + Send>>
) -> &mut Self
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
impl !RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl !UnwindSafe for ClientBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UnsafeAny for T where
T: Any,
T: Any,