1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use crate::Client;
use crate::ClientResult;
pub struct Bots {
pub client: Client,
}
impl Bots {
#[doc(hidden)]
pub fn new(client: Client) -> Self {
Bots { client }
}
/**
* This function performs a `GET` to the `/bots.info` endpoint.
*
* Gets information about a bot user.
*
* FROM: <https://api.slack.com/methods/bots.info>
*
* **Parameters:**
*
* * `token: &str` -- Authentication token. Requires scope: `users:read`.
* * `bot: &str` -- Bot user to get info on.
*/
pub async fn info(
&self,
bot: &str,
) -> ClientResult<crate::Response<crate::types::BotsInfoSchema>> {
let mut query_args: Vec<(String, String)> = Default::default();
if !bot.is_empty() {
query_args.push(("bot".to_string(), bot.to_string()));
}
let query_ = serde_urlencoded::to_string(&query_args).unwrap();
let url = self.client.url(&format!("/bots.info?{}", query_), None);
self.client
.get(
&url,
crate::Message {
body: None,
content_type: None,
},
)
.await
}
}