forgor to set the thread to null

This commit is contained in:
Chayapak 2023-04-22 20:10:52 +07:00
parent 0aa60d3221
commit f9f67d45c7
2 changed files with 4 additions and 1 deletions

View file

@ -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");
}

View file

@ -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;