[−][src]Struct teloxide::BotBuilder
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 inBotBuilder::build
.
#[must_use]pub fn token<S>(self, token: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
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]
Specifies ParseMode
, which will be used during all calls to:
#[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
andTELOXIDE_PROXY
environmental variables. - If it cannot create
reqwest::Client
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for BotBuilder
impl Send for BotBuilder
impl Sync for BotBuilder
impl Unpin for BotBuilder
impl !UnwindSafe for BotBuilder
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[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.
pub 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>,