Compare commits

...

2 Commits

Author SHA1 Message Date
24bb560d93 Register help command
All checks were successful
continuous-integration/drone/push Build is passing
2022-11-21 15:13:32 +01:00
78d5bd6beb Make some messages nicer 2022-11-21 15:07:46 +01:00
3 changed files with 31 additions and 3 deletions

View File

@ -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.
}
}

View File

@ -0,0 +1,27 @@
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
{
public void runSlashCommand(@NotNull SlashCommandInteractionEvent event)
{
// defer reply because replying might take a while
event.deferReply().queue();
EmbedBuilder embedBuilder = new EmbedBuilder();
// embed processing
{
embedBuilder.setColor(Configuration.getBotColor());
embedBuilder.setTitle("Help");
}
event.getHook().editOriginalEmbeds(embedBuilder.build()).queue();
}
}

View File

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