Merge pull request #269 from teloxide/bot_builder_method

add `Bot::builder` method
This commit is contained in:
Temirkhan Myrzamadi 2020-08-23 00:04:49 +06:00 committed by GitHub
commit f571f377b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

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

View file

@ -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>,