diff --git a/src/bot/mod.rs b/src/bot/mod.rs index 3b53b1f2..eaba569d 100644 --- a/src/bot/mod.rs +++ b/src/bot/mod.rs @@ -30,6 +30,7 @@ impl Bot { /// If cannot get the `TELOXIDE_TOKEN` environmental variable. /// /// [`reqwest::Client`]: https://docs.rs/reqwest/0.10.1/reqwest/struct.Client.html + #[deprecated] pub fn from_env_with_client(client: Client) -> Arc { Self::with_client( &std::env::var("TELOXIDE_TOKEN") @@ -42,6 +43,7 @@ impl Bot { /// [`reqwest::Client`]. /// /// [`reqwest::Client`]: https://docs.rs/reqwest/0.10.1/reqwest/struct.Client.html + #[deprecated] pub fn new(token: S) -> Arc where S: Into, @@ -53,6 +55,7 @@ impl Bot { /// [`reqwest::Client`]. /// /// [`reqwest::Client`]: https://docs.rs/reqwest/0.10.1/reqwest/struct.Client.html + #[deprecated] pub fn with_client(token: S, client: Client) -> Arc where S: Into, @@ -92,14 +95,22 @@ impl BotBuilder { } #[must_use] - pub fn token(mut self, token: S) -> Self where S: Into { + pub fn token(mut self, token: S) -> Self + where + S: Into, + { self.token = Some(token.into()); self } #[must_use] pub fn build(self) -> Bot { - Bot { client: self.client.unwrap_or(Client::new()), token: self.token.unwrap_or(std::env::var("TELOXIDE_TOKEN") - .expect("Cannot get the TELOXIDE_TOKEN env variable"))} + Bot { + client: self.client.unwrap_or(Client::new()), + token: self.token.unwrap_or( + std::env::var("TELOXIDE_TOKEN") + .expect("Cannot get the TELOXIDE_TOKEN env variable"), + ), + } } }