diff --git a/src/main/java/org/meteordev/meteorbot/command/commands/moderation/CloseCommand.java b/src/main/java/org/meteordev/meteorbot/command/commands/moderation/CloseCommand.java index ec6f371..3cf691c 100644 --- a/src/main/java/org/meteordev/meteorbot/command/commands/moderation/CloseCommand.java +++ b/src/main/java/org/meteordev/meteorbot/command/commands/moderation/CloseCommand.java @@ -23,6 +23,13 @@ public void run(SlashCommandInteractionEvent event) { return; } + if (event.getMember().getId() == event.getChannel().asThreadChannel().getOwnerId()) { + event.reply("This post is now locked.").queue(hook -> { + event.getChannel().asThreadChannel().getManager().setLocked(true).setArchived(true).queue(); + }); + return; + } + if (!event.getMember().hasPermission(Permission.MANAGE_THREADS)) { event.reply("You don't have permission to lock threads.").setEphemeral(true).queue(); return; @@ -31,6 +38,5 @@ public void run(SlashCommandInteractionEvent event) { event.reply("This post is now locked.").queue(hook -> { event.getChannel().asThreadChannel().getManager().setLocked(true).setArchived(true).queue(); }); - } }