add deprecation note to Bot constructors
@@ -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 and env defaults)"]
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 and env defaults)"]
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 and env defaults)"]
pub fn with_client<S>(token: S, client: Client) -> Self
where
S: Into<String>,
