Skip to content

Commit

Permalink
Add status to edit_channel and include permission
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbt365 committed Oct 18, 2023
1 parent 1c2f65e commit 4339118
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions command_attr/src/structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}))
}
Expand Down
10 changes: 10 additions & 0 deletions src/builder/edit_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ pub struct EditChannel<'a> {
default_sort_order: Option<SortOrder>,
#[serde(skip_serializing_if = "Option::is_none")]
default_forum_layout: Option<ForumLayoutType>,
#[serde(skip_serializing_if = "Option::is_none")]
status: Option<String>,

#[serde(skip)]
audit_log_reason: Option<&'a str>,
Expand Down Expand Up @@ -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<Option<String>>) -> Self {
self.status = status.into();
self
}
}

#[cfg(feature = "http")]
Expand Down

0 comments on commit 4339118

Please sign in to comment.