We have multiple bots using slash commands so if this instance can't find a button/modal/selectmenu it shouldn't respond to it

This commit is contained in:
Teriuihi 2023-01-08 03:48:45 +01:00
parent f93ad8b4fb
commit 265ddd82c3
3 changed files with 21 additions and 21 deletions

View File

@ -36,13 +36,13 @@ public class ButtonManager extends ListenerAdapter {
.filter(discordModal -> discordModal.getButtonId().equalsIgnoreCase(buttonId))
.findFirst();
if (first.isEmpty()) {
event.replyEmbeds(new EmbedBuilder()
.setTitle("Invalid command")
.setDescription("Unable to process button with id: [" + buttonId + "], please report this issue to a Teri")
.setColor(Color.RED)
.build())
.setEphemeral(true)
.queue(RestAction.getDefaultSuccess(), Util::handleFailure);
// event.replyEmbeds(new EmbedBuilder()
// .setTitle("Invalid command")
// .setDescription("Unable to process button with id: [" + buttonId + "], please report this issue to a Teri")
// .setColor(Color.RED)
// .build())
// .setEphemeral(true)
// .queue(RestAction.getDefaultSuccess(), Util::handleFailure);
return;
}
first.get().execute(event);

View File

@ -35,13 +35,13 @@ public class ModalManager extends ListenerAdapter {
.filter(discordModal -> discordModal.getModalId().equalsIgnoreCase(modalId))
.findFirst();
if (first.isEmpty()) {
event.replyEmbeds(new EmbedBuilder()
.setTitle("Invalid command")
.setDescription("Unable to process modal with id: [" + modalId + "], please report this issue to a Teri")
.setColor(Color.RED)
.build())
.setEphemeral(true)
.queue(RestAction.getDefaultSuccess(), Util::handleFailure);
// event.replyEmbeds(new EmbedBuilder()
// .setTitle("Invalid command")
// .setDescription("Unable to process modal with id: [" + modalId + "], please report this issue to a Teri")
// .setColor(Color.RED)
// .build())
// .setEphemeral(true)
// .queue(RestAction.getDefaultSuccess(), Util::handleFailure);
return;
}
first.get().execute(event);

View File

@ -28,13 +28,13 @@ public class SelectMenuManager extends ListenerAdapter {
.filter(discordModal -> discordModal.getSelectMenuId().equalsIgnoreCase(selectMenuId))
.findFirst();
if (first.isEmpty()) {
event.replyEmbeds(new EmbedBuilder()
.setTitle("Invalid command")
.setDescription("Unable to process select menu with id: [" + selectMenuId + "], please report this issue to a Teri")
.setColor(Color.RED)
.build())
.setEphemeral(true)
.queue(RestAction.getDefaultSuccess(), Util::handleFailure);
// event.replyEmbeds(new EmbedBuilder()
// .setTitle("Invalid command")
// .setDescription("Unable to process select menu with id: [" + selectMenuId + "], please report this issue to a Teri")
// .setColor(Color.RED)
// .build())
// .setEphemeral(true)
// .queue(RestAction.getDefaultSuccess(), Util::handleFailure);
return;
}
first.get().execute(event);