From 24bb560d93b2063b282963df02f52d8e662dc497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 21 Nov 2022 15:13:32 +0100 Subject: [PATCH] Register help command --- .../hidekobot/commands/slash/HelpCommand.java | 13 ++++++++++++- .../hidekobot/listeners/SlashCommandListener.java | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/slash/HelpCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/slash/HelpCommand.java index d17c74f..c225958 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/slash/HelpCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/slash/HelpCommand.java @@ -1,7 +1,9 @@ package wtf.beatrice.hidekobot.commands.slash; +import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent; import org.jetbrains.annotations.NotNull; +import wtf.beatrice.hidekobot.Configuration; public class HelpCommand { @@ -11,6 +13,15 @@ public class HelpCommand // defer reply because replying might take a while event.deferReply().queue(); - event.reply("Pong!").queue(); + EmbedBuilder embedBuilder = new EmbedBuilder(); + + // embed processing + { + embedBuilder.setColor(Configuration.getBotColor()); + embedBuilder.setTitle("Help"); + + } + + event.getHook().editOriginalEmbeds(embedBuilder.build()).queue(); } } diff --git a/src/main/java/wtf/beatrice/hidekobot/listeners/SlashCommandListener.java b/src/main/java/wtf/beatrice/hidekobot/listeners/SlashCommandListener.java index bce9da4..791e069 100644 --- a/src/main/java/wtf/beatrice/hidekobot/listeners/SlashCommandListener.java +++ b/src/main/java/wtf/beatrice/hidekobot/listeners/SlashCommandListener.java @@ -17,6 +17,7 @@ public class SlashCommandListener extends ListenerAdapter case "clear" -> new ClearChatCommand().runSlashCommand(event); case "coinflip" -> new CoinFlipCommand().runSlashCommand(event); case "die" -> new DieCommand().runSlashCommand(event); + case "help" -> new HelpCommand().runSlashCommand(event); case "invite" -> new InviteCommand().runSlashCommand(event); case "ping" -> new PingCommand().runSlashCommand(event); }