From f9f67d45c7807f6ea883b6f42bfaf63cd173d7f5 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 22 Apr 2023 20:10:52 +0700 Subject: [PATCH] forgor to set the thread to null --- .../chipmunk/chayapak/chomens_bot/commands/GrepLogCommand.java | 2 ++ .../chipmunk/chayapak/chomens_bot/plugins/GrepLogPlugin.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/GrepLogCommand.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/GrepLogCommand.java index c951336..afa4488 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/GrepLogCommand.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/GrepLogCommand.java @@ -52,6 +52,8 @@ public class GrepLogCommand implements Command { if (bot.grepLog().thread() == null) return Component.text("No query is running").color(NamedTextColor.RED); bot.grepLog().thread().interrupt(); + bot.grepLog().thread(null); + context.sendOutput(Component.text("Log query stopped")); return Component.text("success"); } diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/GrepLogPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/GrepLogPlugin.java index e78858b..b9ff18f 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/GrepLogPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/GrepLogPlugin.java @@ -3,6 +3,7 @@ package land.chipmunk.chayapak.chomens_bot.plugins; import land.chipmunk.chayapak.chomens_bot.Bot; import land.chipmunk.chayapak.chomens_bot.Logger; import lombok.Getter; +import lombok.Setter; import net.dv8tion.jda.api.entities.TextChannel; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; @@ -19,7 +20,7 @@ import java.util.zip.GZIPInputStream; public class GrepLogPlugin { private final Bot bot; - @Getter private GrepLogThread thread = null; + @Getter @Setter private GrepLogThread thread = null; public GrepLogPlugin (Bot bot) { this.bot = bot;