mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Merge pull request #267 from teloxide/bot_new_deprecation_messages
add deprecation note to Bot constructors
This commit is contained in:
commit
7f822303b6
1 changed files with 5 additions and 6 deletions
|
@ -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>,
|
||||
|
|
Loading…
Add table
Reference in a new issue