diff options
| author | seth <[email protected]> | 2023-12-05 09:25:45 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-12-15 16:41:13 -0500 |
| commit | d7375df648d930b674bb4b49c6fc33fe6bf827fb (patch) | |
| tree | ca647614b5d6e3039d993be836ed65c7cf5a6467 /src/commands/moderation/config.rs | |
| parent | 1b6eb2e5ef4eab269235aa833b7347afd13c3613 (diff) | |
fix: permission checks for prefix commands
ihateprefixcommands
ihateprefixcommands
ihateprefixcommands
ihateprefixcommands
ihateprefixcommands
ihateprefixcommands
ihateprefixcommands
ihateprefixcommands
Diffstat (limited to 'src/commands/moderation/config.rs')
| -rw-r--r-- | src/commands/moderation/config.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/commands/moderation/config.rs b/src/commands/moderation/config.rs index b2b0ab4..967e585 100644 --- a/src/commands/moderation/config.rs +++ b/src/commands/moderation/config.rs @@ -39,6 +39,7 @@ fn prop_to_val(setting: &SettingsProperties, settings: &Settings) -> String { slash_command, prefix_command, subcommands("set", "get"), + required_permissions = "MANAGE_GUILD", default_member_permissions = "MANAGE_GUILD" )] pub async fn config(_ctx: Context<'_>) -> Result<()> { @@ -46,7 +47,13 @@ pub async fn config(_ctx: Context<'_>) -> Result<()> { } #[allow(clippy::too_many_arguments)] -#[poise::command(slash_command, prefix_command, ephemeral, guild_only)] +#[poise::command( + slash_command, + prefix_command, + ephemeral, + guild_only, + required_permissions = "MANAGE_GUILD" +)] pub async fn set( ctx: Context<'_>, #[channel_types("Text")] @@ -129,7 +136,13 @@ pub async fn set( Ok(()) } -#[poise::command(slash_command, prefix_command, ephemeral, guild_only)] +#[poise::command( + slash_command, + prefix_command, + ephemeral, + guild_only, + required_permissions = "MANAGE_GUILD" +)] pub async fn get( ctx: Context<'_>, #[description = "The setting you want to get"] setting: SettingsProperties, |
