From 7dcdf9dbde7ab37b08d730e6cedf0d66bf7addd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Tue, 20 Dec 2022 15:04:39 +0100 Subject: [PATCH] Remove duplication --- .../java/wtf/beatrice/hidekobot/commands/base/ClearChat.java | 2 +- .../beatrice/hidekobot/commands/base/UrbanDictionary.java | 2 +- .../hidekobot/listeners/ButtonInteractionListener.java | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/base/ClearChat.java b/src/main/java/wtf/beatrice/hidekobot/commands/base/ClearChat.java index c632e12..aa20826 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/base/ClearChat.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/base/ClearChat.java @@ -150,7 +150,7 @@ public class ClearChat public static Button getDismissButton() { - return Button.primary("clear_dismiss", "Dismiss") + return Button.primary("generic_dismiss", "Dismiss") .withEmoji(Emoji.fromUnicode("❌")); } diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/base/UrbanDictionary.java b/src/main/java/wtf/beatrice/hidekobot/commands/base/UrbanDictionary.java index e8b0823..ae7db4d 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/base/UrbanDictionary.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/base/UrbanDictionary.java @@ -45,7 +45,7 @@ public class UrbanDictionary public static Button getDeleteButton() { - return Button.danger("urban_delete", "Delete") + return Button.danger("generic_dismiss", "Delete") .withEmoji(Emoji.fromFormatted("\uD83D\uDDD1️")); } diff --git a/src/main/java/wtf/beatrice/hidekobot/listeners/ButtonInteractionListener.java b/src/main/java/wtf/beatrice/hidekobot/listeners/ButtonInteractionListener.java index 1d07966..bf62f37 100644 --- a/src/main/java/wtf/beatrice/hidekobot/listeners/ButtonInteractionListener.java +++ b/src/main/java/wtf/beatrice/hidekobot/listeners/ButtonInteractionListener.java @@ -18,13 +18,12 @@ public class ButtonInteractionListener extends ListenerAdapter // coinflip case "coinflip_reflip" -> CoinFlip.buttonReFlip(event); - // clearchat command - case "clear_dismiss" -> CommandUtil.delete(event); + // generic dismiss button + case "generic_dismiss" -> CommandUtil.delete(event); // urban dictionary navigation case "urban_nextpage" -> UrbanDictionary.changePage(event, true); case "urban_previouspage" -> UrbanDictionary.changePage(event, false); - case "urban_delete" -> CommandUtil.delete(event); }