Merge pull request #281 from teloxide/v0.3.1_release

bring v0.3.1 to dev
This commit is contained in:
Temirkhan Myrzamadi 2020-10-01 18:21:00 +06:00 committed by GitHub
commit 0d3694559b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 14 deletions

View file

@ -25,6 +25,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[issue 253]: https://github.com/teloxide/teloxide/issues/253
[pr 257]: https://github.com/teloxide/teloxide/pull/257
## [0.3.1] - 2020-08-25
### 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

@ -1,6 +1,6 @@
[package]
name = "teloxide"
version = "0.3.0"
version = "0.3.1"
edition = "2018"
description = "An elegant Telegram bots framework for Rust"
repository = "https://github.com/teloxide/teloxide"

View file

@ -1,18 +1,17 @@
<div align="center">
<img src="ICON.png" width="250"/>
<h1>teloxide</h1>
<a href="https://docs.rs/teloxide/">
<img src="https://docs.rs/teloxide/badge.svg">
</a>
<a href="https://github.com/teloxide/teloxide/actions">
<img src="https://github.com/teloxide/teloxide/workflows/Continuous%20integration/badge.svg">
</a>
<a href="https://teloxide.netlify.com">
<img src="https://img.shields.io/badge/docs-dev-blue)">
</a>
<a href="https://docs.rs/teloxide/">
<img src="https://img.shields.io/badge/docs.rs-v0.3.0-blue.svg">
</a>
<a href="https://crates.io/crates/teloxide">
<img src="https://img.shields.io/badge/crates.io-v0.3.0-orange.svg">
<img src="https://img.shields.io/crates/v/teloxide.svg">
</a>
<a href="https://core.telegram.org/bots/api">
<img src="https://img.shields.io/badge/API coverage-Up to 0.4.9 (inclusively)-green.svg">
@ -79,7 +78,7 @@ $ rustup override set nightly
5. Execute `cargo new my_bot`, enter the directory and put these lines into your `Cargo.toml`:
```toml
[dependencies]
teloxide = "0.3.0"
teloxide = "0.3.1"
teloxide-macros = "0.3.2"
log = "0.4.8"

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`].
@ -55,9 +63,10 @@ impl Bot {
///
/// [`reqwest::Client`]: https://docs.rs/reqwest/0.10.1/reqwest/struct.Client.html
/// [issue 223]: https://github.com/teloxide/teloxide/issues/223
#[deprecated]
#[allow(deprecated)]
#[deprecated = "Deprecated in favour of BotBuilder because the later provides more options \
(notably default parse_mode)"]
pub fn from_env_with_client(client: Client) -> Self {
#[allow(deprecated)]
Self::with_client(&get_env(TELOXIDE_TOKEN), client)
}
@ -68,12 +77,13 @@ impl Bot {
/// If it cannot create [`reqwest::Client`].
///
/// [`reqwest::Client`]: https://docs.rs/reqwest/latest/reqwest/struct.Client.html
#[deprecated]
#[allow(deprecated)]
#[deprecated = "Deprecated in favour of BotBuilder because the later provides more options \
(notably default parse_mode)"]
pub fn new<S>(token: S) -> Self
where
S: Into<String>,
{
#[allow(deprecated)]
Self::with_client(token, build_sound_bot())
}
@ -86,8 +96,8 @@ impl Bot {
///
/// [`reqwest::Client`]: https://docs.rs/reqwest/latest/reqwest/struct.Client.html
/// [issue 223]: https://github.com/teloxide/teloxide/issues/223
#[deprecated]
#[allow(deprecated)]
#[deprecated = "Deprecated in favour of BotBuilder because the later provides more options \
(notably default parse_mode)"]
pub fn with_client<S>(token: S, client: Client) -> Self
where
S: Into<String>,
@ -142,7 +152,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>,