Skip to content

Commit 386df6c

Browse files
committed
Added error message to user if no permission
1 parent 8f18863 commit 386df6c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

application/src/main/java/org/togetherjava/tjbot/commands/basic/DatabaseCommand.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ private void handlePutCommand(CommandInteraction event) {
120120
// To prevent people from saving malicious content, only users with
121121
// elevated permissions are allowed to use this command
122122
if (!Objects.requireNonNull(event.getMember()).hasPermission(Permission.MESSAGE_MANAGE)) {
123+
event.reply("You need the MESSAGE_MANAGE permission to use this command")
124+
.setEphemeral(true)
125+
.queue();
123126
return;
124127
}
125128

0 commit comments

Comments
 (0)