From 96953bddcb3a45c92463cb431d00947f65cc908c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Sun, 20 Nov 2022 05:43:17 +0100 Subject: [PATCH] Make messages prettier --- .../listeners/SlashCommandListener.java | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/main/java/wtf/beatrice/hidekobot/listeners/SlashCommandListener.java b/src/main/java/wtf/beatrice/hidekobot/listeners/SlashCommandListener.java index 101b146..388fd6b 100644 --- a/src/main/java/wtf/beatrice/hidekobot/listeners/SlashCommandListener.java +++ b/src/main/java/wtf/beatrice/hidekobot/listeners/SlashCommandListener.java @@ -59,7 +59,7 @@ public class SlashCommandListener extends ListenerAdapter } else { // answer by saying that the operation has begun. - InteractionHook replyInteraction = event.reply("Clearing...").complete(); + InteractionHook replyInteraction = event.reply("\uD83D\uDEA7 Clearing...").complete(); // int to keep track of how many messages we deleted. int deleted = 0; @@ -146,8 +146,8 @@ public class SlashCommandListener extends ListenerAdapter a less efficient way that triggers rate-limiting very quickly. */ } catch (Exception e) { - replyInteraction.editOriginal("Sorry, it seems like there was an issue! " + e.getMessage()).queue(); - return; + replyInteraction.editOriginal("\uD83D\uDE22 Sorry, it seems like there was an issue! " + e.getMessage()).queue(); + return; // warning: this quits everything. } } @@ -159,24 +159,15 @@ public class SlashCommandListener extends ListenerAdapter // log having deleted the messages. if(deleted < 1) { - replyInteraction.editOriginal("Couldn't clear any message!").queue(); + replyInteraction.editOriginal("\uD83D\uDE22 Couldn't clear any message!").queue(); } else if(deleted == 1) { - replyInteraction.editOriginal("Cleared 1 message!").queue(); + replyInteraction.editOriginal("✂ Cleared 1 message!").queue(); } else { - replyInteraction.editOriginal("Cleared " + deleted + " messages!").queue(); + replyInteraction.editOriginal("✂ Cleared " + deleted + " messages!").queue(); } } - /*MessageHistory.MessageRetrieveAction action = channel.getHistoryBefore(event.getInteraction().getIdLong(), toDeleteAmount); - List messages = action.complete().getRetrievedHistory(); - - //more than 2 messages, less than 100 for this method - ((TextChannel) channel).deleteMessages(messages).queue(); - - // announce having cleared the messages. - replyInteraction.editOriginal("Cleared " + toDeleteAmount + " messages!").queue();*/ - } }