mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Merge pull request #269 from teloxide/bot_builder_method
add `Bot::builder` method
This commit is contained in:
commit
f571f377b4
2 changed files with 14 additions and 1 deletions
|
@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [unreleased]
|
||||
|
||||
### Added
|
||||
- `Bot::builder` method ([PR 269](https://github.com/teloxide/teloxide/pull/269)).
|
||||
|
||||
## [0.3.0] - 2020-07-31
|
||||
### Added
|
||||
- Support for typed bot commands ([issue 152](https://github.com/teloxide/teloxide/issues/152)).
|
||||
|
|
|
@ -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`].
|
||||
|
@ -142,7 +150,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