From 4339118540a7fd85e8b00cd6b725b1590bfa3735 Mon Sep 17 00:00:00 2001 From: jamesbt365 Date: Wed, 18 Oct 2023 19:06:36 +0100 Subject: [PATCH] Add status to edit_channel and include permission --- command_attr/src/structures.rs | 1 + src/builder/edit_channel.rs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/command_attr/src/structures.rs b/command_attr/src/structures.rs index 82265213c4e..5b5375d9f37 100644 --- a/command_attr/src/structures.rs +++ b/command_attr/src/structures.rs @@ -345,6 +345,7 @@ impl Permissions { "SEND_MESSAGES_IN_THREADS" => 1 << 38, "USE_EMBEDDED_ACTIVITIES" => 1 << 39, "MODERATE_MEMBERS" => 1 << 40, + "SET_VOICE_CHANNEL_STATUS" => 1 << 48, _ => return None, })) } diff --git a/src/builder/edit_channel.rs b/src/builder/edit_channel.rs index 1b895506687..d45924e362e 100644 --- a/src/builder/edit_channel.rs +++ b/src/builder/edit_channel.rs @@ -72,6 +72,8 @@ pub struct EditChannel<'a> { default_sort_order: Option, #[serde(skip_serializing_if = "Option::is_none")] default_forum_layout: Option, + #[serde(skip_serializing_if = "Option::is_none")] + status: Option, #[serde(skip)] audit_log_reason: Option<&'a str>, @@ -287,6 +289,14 @@ impl<'a> EditChannel<'a> { self.default_forum_layout = Some(default_forum_layout); self } + /// The status of a voice channel. + /// The user must be within the channel to change the status but if the + /// user has Manage Channels the user can reset it without being in the channel. + /// Can be None, an empty string or up to 500 characters. + pub fn status(mut self, status: impl Into>) -> Self { + self.status = status.into(); + self + } } #[cfg(feature = "http")]