Skip to content

Commit c935b13

Browse files
committed
restrict server settings command to those with manage channel permission
1 parent 5433e11 commit c935b13

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/commands/guild/server_settings.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ use async_trait::async_trait;
44
use futures::StreamExt;
55
use serenity::{
66
builder::{CreateApplicationCommand, CreateInteractionResponse},
7-
model::prelude::{
8-
command::CommandType,
9-
component::{ActionRowComponent, InputTextStyle},
10-
interaction::{
11-
application_command::ApplicationCommandInteraction,
12-
message_component::MessageComponentInteraction, InteractionResponseType,
7+
model::{
8+
prelude::{
9+
command::CommandType,
10+
component::{ActionRowComponent, InputTextStyle},
11+
interaction::{
12+
application_command::ApplicationCommandInteraction,
13+
message_component::MessageComponentInteraction, InteractionResponseType,
14+
},
15+
Message,
1316
},
14-
Message,
17+
Permissions,
1518
},
1619
prelude::Context,
1720
};
@@ -317,7 +320,8 @@ impl AppCmd for ServerSettingsCmd {
317320
let mut cmd = CreateApplicationCommand::default();
318321
cmd.localized_name(NAME)
319322
.kind(CommandType::ChatInput)
320-
.localized_desc(DESC);
323+
.localized_desc(DESC)
324+
.default_member_permissions(Permissions::MANAGE_CHANNELS);
321325
cmd
322326
}
323327

0 commit comments

Comments
 (0)