Skip to main content

neptunium_http/endpoints/webhooks/
list_channel_webhooks.rs

1use bon::Builder;
2use neptunium_model::{
3    guild::webhook::Webhook,
4    id::{Id, marker::ChannelMarker},
5};
6use reqwest::Method;
7
8use crate::{endpoints::Endpoint, request::Request};
9
10#[derive(Builder, Copy, Clone, Debug)]
11pub struct ListChannelWebhooks {
12    pub channel_id: Id<ChannelMarker>,
13}
14
15impl Endpoint for ListChannelWebhooks {
16    type Response = Vec<Webhook>;
17
18    fn into_request(self) -> crate::request::Request {
19        Request::builder()
20            .method(Method::GET)
21            .path(format!("/channels/{}/webhooks", self.channel_id))
22            .build()
23    }
24}