mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
add Bot::builder
method
This commit is contained in:
parent
5985f62bfe
commit
4c2681ca27
1 changed files with 9 additions and 1 deletions
|
@ -24,6 +24,14 @@ pub struct Bot {
|
|||
}
|
||||
|
||||
impl Bot {
|
||||
/// Creates new [`BotBuilder`] see it's [docs] for more
|
||||
///
|
||||
/// [docs]: BotBuilder
|
||||
#[must_use]
|
||||
pub fn builder() -> BotBuilder {
|
||||
BotBuilder::new()
|
||||
}
|
||||
|
||||
/// Creates a new `Bot` with the `TELOXIDE_TOKEN` & `TELOXIDE_PROXY`
|
||||
/// environmental variables (a bot's token & a proxy) and the default
|
||||
/// [`reqwest::Client`].
|
||||
|
@ -143,7 +151,7 @@ impl Bot {
|
|||
|
||||
/// A builder of [`Bot`], supporting some extra settings.
|
||||
///
|
||||
/// [`Bot`] crate::Bot
|
||||
/// [`Bot`]: crate::Bot
|
||||
#[derive(Debug, Default)]
|
||||
pub struct BotBuilder {
|
||||
token: Option<String>,
|
||||
|
|
Loading…
Add table
Reference in a new issue