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:
parent
f93ad8b4fb
commit
265ddd82c3
|
|
@ -36,13 +36,13 @@ public class ButtonManager extends ListenerAdapter {
|
||||||
.filter(discordModal -> discordModal.getButtonId().equalsIgnoreCase(buttonId))
|
.filter(discordModal -> discordModal.getButtonId().equalsIgnoreCase(buttonId))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
if (first.isEmpty()) {
|
if (first.isEmpty()) {
|
||||||
event.replyEmbeds(new EmbedBuilder()
|
// event.replyEmbeds(new EmbedBuilder()
|
||||||
.setTitle("Invalid command")
|
// .setTitle("Invalid command")
|
||||||
.setDescription("Unable to process button with id: [" + buttonId + "], please report this issue to a Teri")
|
// .setDescription("Unable to process button with id: [" + buttonId + "], please report this issue to a Teri")
|
||||||
.setColor(Color.RED)
|
// .setColor(Color.RED)
|
||||||
.build())
|
// .build())
|
||||||
.setEphemeral(true)
|
// .setEphemeral(true)
|
||||||
.queue(RestAction.getDefaultSuccess(), Util::handleFailure);
|
// .queue(RestAction.getDefaultSuccess(), Util::handleFailure);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
first.get().execute(event);
|
first.get().execute(event);
|
||||||
|
|
|
||||||
|
|
@ -35,13 +35,13 @@ public class ModalManager extends ListenerAdapter {
|
||||||
.filter(discordModal -> discordModal.getModalId().equalsIgnoreCase(modalId))
|
.filter(discordModal -> discordModal.getModalId().equalsIgnoreCase(modalId))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
if (first.isEmpty()) {
|
if (first.isEmpty()) {
|
||||||
event.replyEmbeds(new EmbedBuilder()
|
// event.replyEmbeds(new EmbedBuilder()
|
||||||
.setTitle("Invalid command")
|
// .setTitle("Invalid command")
|
||||||
.setDescription("Unable to process modal with id: [" + modalId + "], please report this issue to a Teri")
|
// .setDescription("Unable to process modal with id: [" + modalId + "], please report this issue to a Teri")
|
||||||
.setColor(Color.RED)
|
// .setColor(Color.RED)
|
||||||
.build())
|
// .build())
|
||||||
.setEphemeral(true)
|
// .setEphemeral(true)
|
||||||
.queue(RestAction.getDefaultSuccess(), Util::handleFailure);
|
// .queue(RestAction.getDefaultSuccess(), Util::handleFailure);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
first.get().execute(event);
|
first.get().execute(event);
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,13 @@ public class SelectMenuManager extends ListenerAdapter {
|
||||||
.filter(discordModal -> discordModal.getSelectMenuId().equalsIgnoreCase(selectMenuId))
|
.filter(discordModal -> discordModal.getSelectMenuId().equalsIgnoreCase(selectMenuId))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
if (first.isEmpty()) {
|
if (first.isEmpty()) {
|
||||||
event.replyEmbeds(new EmbedBuilder()
|
// event.replyEmbeds(new EmbedBuilder()
|
||||||
.setTitle("Invalid command")
|
// .setTitle("Invalid command")
|
||||||
.setDescription("Unable to process select menu with id: [" + selectMenuId + "], please report this issue to a Teri")
|
// .setDescription("Unable to process select menu with id: [" + selectMenuId + "], please report this issue to a Teri")
|
||||||
.setColor(Color.RED)
|
// .setColor(Color.RED)
|
||||||
.build())
|
// .build())
|
||||||
.setEphemeral(true)
|
// .setEphemeral(true)
|
||||||
.queue(RestAction.getDefaultSuccess(), Util::handleFailure);
|
// .queue(RestAction.getDefaultSuccess(), Util::handleFailure);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
first.get().execute(event);
|
first.get().execute(event);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user