serenity/model/channel/
partial_channel.rs

1use crate::model::channel::{ChannelType, ThreadMetadata};
2use crate::model::id::{ChannelId, WebhookId};
3use crate::model::Permissions;
4
5/// A container for any partial channel.
6///
7/// [Discord docs](https://discord.com/developers/docs/resources/channel#channel-object),
8/// [subset specification](https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure).
9#[cfg_attr(feature = "typesize", derive(typesize::derive::TypeSize))]
10#[derive(Clone, Debug, Deserialize, Serialize)]
11#[non_exhaustive]
12pub struct PartialChannel {
13    /// The channel Id.
14    pub id: ChannelId,
15    /// The channel name.
16    pub name: Option<String>,
17    /// The channel type.
18    #[serde(rename = "type")]
19    pub kind: ChannelType,
20    /// The channel permissions.
21    pub permissions: Option<Permissions>,
22    /// The thread metadata.
23    ///
24    /// **Note**: This is only available on thread channels.
25    pub thread_metadata: Option<ThreadMetadata>,
26    /// The Id of the parent category for a channel, or of the parent text channel for a thread.
27    ///
28    /// **Note**: This is only available on thread channels.
29    pub parent_id: Option<ChannelId>,
30}
31
32/// A container for the IDs returned by following a news channel.
33///
34/// [Discord docs](https://discord.com/developers/docs/resources/channel#followed-channel-object).
35#[derive(Clone, Debug, Deserialize, Serialize)]
36#[non_exhaustive]
37pub struct FollowedChannel {
38    /// The source news channel
39    pub channel_id: ChannelId,
40    /// The created webhook ID in the target channel
41    pub webhook_id: WebhookId,
42}