Skip to content

Commit b038bee

Browse files
fix: quickstart allowed setting of management permissions on channels
1 parent 70a267c commit b038bee

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ enum InteractionOrRequestFinalStatus {
2727
NO_PERMISSION_TO_REMOVE,
2828
TAG_NOT_FOUND,
2929
NO_PERMISSIONS_PRESET_SELECTED,
30-
MANAGE_CONFIG_PERMISSION_CANNOT_BE_SET_ON_CHANNEL_LEVEL,
30+
MANAGEMENT_PERMISSIONS_CANNOT_BE_SET_ON_CHANNEL_LEVEL,
3131
GENERIC_EXPECTED_PERMISSIONS_FAILURE = 3000,
3232
USER_MISSING_DISCORD_PERMISSION,
3333
BOT_MISSING_DISCORD_PERMISSION,

src/interactions/commands/chatInput/config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,13 @@ async function handlePermissionsQuickstartSubcommand({
395395
);
396396
}
397397

398+
if (managementPreset && channel === undefined) {
399+
throw new ExpectedFailure(
400+
InteractionOrRequestFinalStatus.MANAGEMENT_PERMISSIONS_CANNOT_BE_SET_ON_CHANNEL_LEVEL,
401+
"The management preset can only be set on guild level - leave as false to set message access"
402+
);
403+
}
404+
398405
let permissions: number[] = [];
399406
if (messagePreset) {
400407
permissions = [

0 commit comments

Comments
 (0)