fixed @mention not responding

This commit is contained in:
AffluentAvo
2020-08-07 16:49:18 +02:00
parent 44c4a944a0
commit 971a9c3328
@@ -73,16 +73,19 @@ public class CommandListener extends ListenerAdapter {
String prefix = Bot.getPrefix(guild); String prefix = Bot.getPrefix(guild);
String arg = args[0].toLowerCase(); String arg = args[0].toLowerCase();
boolean isCommand; boolean isCommand;
if (arg.startsWith(prefix)) { if (isMention) isCommand = true;
if (commandsNoPrefix.contains(arg)) { else {
isCommand = true; if (arg.startsWith(prefix)) {
if (commandsNoPrefix.contains(arg)) {
isCommand = true;
} else {
String commandName = arg.substring(prefix.length()).toLowerCase();
isCommand = commands.containsKey(commandName);
if (isCommand) arg = commandName;
}
} else { } else {
String commandName = arg.substring(prefix.length()).toLowerCase(); isCommand = commandsNoPrefix.contains(arg);
isCommand = commands.containsKey(commandName);
if (isCommand) arg = commandName;
} }
} else {
isCommand = commandsNoPrefix.contains(arg);
} }
if (isCommand) { if (isCommand) {
if (!hasPermissions(guild, channel)) { if (!hasPermissions(guild, channel)) {