1use crate::Client;
2use crate::ClientResult;
3
4pub struct Bots {
5 pub client: Client,
6}
7
8impl Bots {
9 #[doc(hidden)]
10 pub fn new(client: Client) -> Self {
11 Bots { client }
12 }
13
14 pub async fn info(
27 &self,
28 bot: &str,
29 ) -> ClientResult<crate::Response<crate::types::BotsInfoSchema>> {
30 let mut query_args: Vec<(String, String)> = Default::default();
31 if !bot.is_empty() {
32 query_args.push(("bot".to_string(), bot.to_string()));
33 }
34 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
35 let url = self.client.url(&format!("/bots.info?{}", query_), None);
36 self.client
37 .get(
38 &url,
39 crate::Message {
40 body: None,
41 content_type: None,
42 },
43 )
44 .await
45 }
46}