From 78d5bd6beb55e9a53f1bc6e1f3e441bd4cb0004b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 21 Nov 2022 15:07:46 +0100 Subject: [PATCH] Make some messages nicer --- .../commands/slash/ClearChatCommand.java | 6 +++--- .../hidekobot/commands/slash/HelpCommand.java | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 src/main/java/wtf/beatrice/hidekobot/commands/slash/HelpCommand.java diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/slash/ClearChatCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/slash/ClearChatCommand.java index c2600c5..879f60a 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/slash/ClearChatCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/slash/ClearChatCommand.java @@ -31,7 +31,7 @@ public class ClearChatCommand if(!(channel instanceof TextChannel)) { - event.reply("Sorry! I can't delete messages here.").queue(); + event.reply("\uD83D\uDE22 Sorry! I can't delete messages here.").queue(); return; } @@ -43,7 +43,7 @@ public class ClearChatCommand if(toDeleteAmount <= 0) { - event.reply("Sorry, I can't delete that amount of messages!").queue(); + event.reply("\uD83D\uDE22 Sorry, I can't delete that amount of messages!").queue(); } else { // answer by saying that the operation has begun. @@ -134,7 +134,7 @@ public class ClearChatCommand a less efficient way that triggers rate-limiting very quickly. */ } catch (Exception e) { - replyInteraction.editOriginal("\uD83D\uDE22 Sorry, it seems like there was an issue! " + e.getMessage()).queue(); + replyInteraction.editOriginal("\uD83D\uDE22 Sorry, I ran into an error! " + e.getMessage()).queue(); return; // warning: this quits everything. } } diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/slash/HelpCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/slash/HelpCommand.java new file mode 100644 index 0000000..d17c74f --- /dev/null +++ b/src/main/java/wtf/beatrice/hidekobot/commands/slash/HelpCommand.java @@ -0,0 +1,16 @@ +package wtf.beatrice.hidekobot.commands.slash; + +import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent; +import org.jetbrains.annotations.NotNull; + +public class HelpCommand +{ + + public void runSlashCommand(@NotNull SlashCommandInteractionEvent event) + { + // defer reply because replying might take a while + event.deferReply().queue(); + + event.reply("Pong!").queue(); + } +}