From f1c09b7069094cbe3ca33a8062af692cfc8bd5da Mon Sep 17 00:00:00 2001 From: Talhoid <68508139+Talhoid@users.noreply.github.com> Date: Sun, 9 Apr 2023 12:51:59 -0400 Subject: [PATCH] let the owner of the support post close their own post --- .../command/commands/moderation/CloseCommand.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(); }); - } }