Merge pull request #267 from teloxide/bot_new_deprecation_messages

add deprecation note to Bot constructors
This commit is contained in:
Temirkhan Myrzamadi 2020-08-21 18:28:08 +06:00 committed by GitHub
commit 7f822303b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,9 +56,9 @@ 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)
}
@ -69,12 +69,12 @@ 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())
}
@ -87,8 +87,7 @@ 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>,