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
use serde::Serialize;
use crate::{
net,
requests::{Request, ResponseResult},
types::WebhookInfo,
Bot,
};
use std::sync::Arc;
#[derive(Debug, Clone, Serialize)]
pub struct GetWebhookInfo {
#[serde(skip_serializing)]
bot: Arc<Bot>,
}
#[async_trait::async_trait]
impl Request for GetWebhookInfo {
type Output = WebhookInfo;
#[allow(clippy::trivially_copy_pass_by_ref)]
async fn send(&self) -> ResponseResult<WebhookInfo> {
net::request_json(
self.bot.client(),
self.bot.token(),
"getWebhookInfo",
&self,
)
.await
}
}
impl GetWebhookInfo {
pub(crate) fn new(bot: Arc<Bot>) -> Self {
Self { bot }
}
}