Remove duplicated method

This commit is contained in:
2022-12-20 14:49:44 +01:00
parent 4476dd2f7b
commit fc846fa901
4 changed files with 31 additions and 28 deletions

View File

@@ -179,20 +179,6 @@ public class ClearChat
}
}
public static void dismissMessage(ButtonInteractionEvent event)
{
if(!(Cache.getDatabaseSource().isUserTrackedFor(event.getUser().getId(), event.getMessageId())))
{
event.reply("❌ You did not run this command!").setEphemeral(true).queue();
} else
{
event.getInteraction().getMessage().delete().queue();
}
}
// cap the amount to avoid abuse.
public static int getMaxAmount() { return 1000; }

View File

@@ -120,19 +120,7 @@ public class UrbanDictionary
}
public static void delete(ButtonInteractionEvent event)
{
String messageId = event.getMessageId();
DatabaseSource database = Cache.getDatabaseSource();
// check if the user interacting is the same one who ran the command
if (!(database.isUserTrackedFor(event.getUser().getId(), messageId))) {
event.reply("❌ You did not run this command!").setEphemeral(true).queue();
return;
}
event.getInteraction().getMessage().delete().queue();
}
public static void track(Message message, User user, UrbanSearch search, String sanitizedTerm)
{