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

This commit is contained in:
Teriuihi 2023-01-04 02:28:49 +01:00
parent 9ed3146a73
commit f93ad8b4fb

View File

@ -63,13 +63,13 @@ public class CommandManager extends ListenerAdapter {
.filter(discordCommand -> discordCommand.getName().equalsIgnoreCase(commandName)) .filter(discordCommand -> discordCommand.getName().equalsIgnoreCase(commandName))
.findFirst(); .findFirst();
if (first.isEmpty()) { if (first.isEmpty()) {
event.replyEmbeds(new EmbedBuilder() // event.replyEmbeds(new EmbedBuilder()
.setTitle("Invalid command") // .setTitle("Invalid command")
.setDescription("We couldn't find a command called [" + commandName + "], please report this issue to a Teri") // .setDescription("We couldn't find a command called [" + commandName + "], please report this issue to a Teri")
.setColor(Color.RED) // .setColor(Color.RED)
.build()) // .build())
.setEphemeral(true) // .setEphemeral(true)
.queue(); // .queue();
return; return;
} }
first.get().execute(event); first.get().execute(event);