Skip to content

Commit

Permalink
Rename Permissions::USE_SLASH_COMMANDS to USE_APPLICATION_COMMANDS (
Browse files Browse the repository at this point in the history
serenity-rs#1977)

The permission was renamed by Discord in regards to the new context menu commands.
  • Loading branch information
nickelc authored and mkrasnitski committed Oct 17, 2023
1 parent dc9816c commit ca531ca
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/model/permissions.rs
Expand Up @@ -335,8 +335,9 @@ bitflags::bitflags! {
///
/// [`Integration`]: super::guild::Integration
const MANAGE_EMOJIS_AND_STICKERS = 1 << 30;
/// Allows using slash commands.
const USE_SLASH_COMMANDS = 1 << 31;
/// Allows members to use application commands, including slash commands and context menu
/// commands.
const USE_APPLICATION_COMMANDS = 1 << 31;
/// Allows for requesting to speak in stage channels.
const REQUEST_TO_SPEAK = 1 << 32;
/// Allows for creating, editing, and deleting scheduled events
Expand Down Expand Up @@ -395,10 +396,10 @@ generate_get_permission_names! {
send_tts_messages: "Send TTS Messages",
speak: "Speak",
stream: "Stream",
use_application_commands: "Use Application Commands",
use_embedded_activities: "Use Embedded Activities",
use_external_emojis: "Use External Emojis",
use_external_stickers: "Use External Stickers",
use_slash_commands: "Use Slash Commands",
use_vad: "Use Voice Activity",
view_audit_log: "View Audit Log",
view_channel: "View Channel",
Expand Down Expand Up @@ -769,12 +770,12 @@ impl Permissions {
}

/// Shorthand for checking that the set of permissions contains the
/// [Use Slash Commands] permission.
/// [Use Application Commands] permission.
///
/// [Use Slash Commands]: Self::USE_SLASH_COMMANDS
/// [Use Application Commands]: Self::USE_APPLICATION_COMMANDS
#[must_use]
pub fn use_slash_commands(self) -> bool {
self.contains(Self::USE_SLASH_COMMANDS)
pub fn use_application_commands(self) -> bool {
self.contains(Self::USE_APPLICATION_COMMANDS)
}

/// Shorthand for checking that the set of permissions contains the
Expand Down

0 comments on commit ca531ca

Please sign in to comment.