[][src]Struct teloxide::BotBuilder

pub struct BotBuilder { /* fields omitted */ }

A builder of Bot, supporting some extra settings.

Implementations

impl BotBuilder[src]

#[must_use]pub fn new() -> Self[src]

#[must_use]pub fn client(self, client: Client) -> Self[src]

Specifies a custom HTTPS client. Otherwise, the default will be used.

Caution

  • Your custom client might not be configured correctly to be able to work in long time durations, see issue 223.

  • If this method is used, the TELOXIDE_PROXY environmental variable won't be extracted in BotBuilder::build.

#[must_use]pub fn token<S>(self, token: S) -> Self where
    S: Into<String>, 
[src]

Specified a custom token.

Otherwise, a token will be extracted from the TELOXIDE_TOKEN environmental variable.

#[must_use]pub fn parse_mode(self, parse_mode: ParseMode) -> Self[src]

#[must_use]pub fn build(self) -> Bot[src]

Builds Bot.

This method will attempt to build a new client with a proxy, specified in the TELOXIDE_PROXY (passed into reqwest::Proxy::all) environmental variable, if a client haven't been specified.

Panics

  • If cannot get the TELOXIDE_TOKEN and TELOXIDE_PROXY environmental variables.
  • If it cannot create reqwest::Client.

Trait Implementations

impl Debug for BotBuilder[src]

impl Default for BotBuilder[src]

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> 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.