Move command handling out of constructor, add coin reflip command
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Having heavy code run in a constructor is bad practice. We made separate methods for command handling.
This commit is contained in:
@@ -6,6 +6,7 @@ import net.dv8tion.jda.api.OnlineStatus;
|
||||
import net.dv8tion.jda.api.entities.Activity;
|
||||
import net.dv8tion.jda.api.requests.GatewayIntent;
|
||||
import sun.misc.Signal;
|
||||
import wtf.beatrice.hidekobot.listeners.ButtonInteractionListener;
|
||||
import wtf.beatrice.hidekobot.listeners.MessageListener;
|
||||
import wtf.beatrice.hidekobot.listeners.SlashCommandCompleter;
|
||||
import wtf.beatrice.hidekobot.listeners.SlashCommandListener;
|
||||
@@ -81,6 +82,7 @@ public class HidekoBot
|
||||
jda.addEventListener(new MessageListener());
|
||||
jda.addEventListener(new SlashCommandListener());
|
||||
jda.addEventListener(new SlashCommandCompleter());
|
||||
jda.addEventListener(new ButtonInteractionListener());
|
||||
|
||||
// update slash commands (delayed)
|
||||
final boolean finalForceUpdateCommands = forceUpdateCommands;
|
||||
|
Reference in New Issue
Block a user