Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

Commit

Permalink
Fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
SlamaFR committed Aug 12, 2019
1 parent 14a1723 commit 180831c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/java/fr/slama/yeahbot/commands/core/CommandMap.java
Expand Up @@ -46,6 +46,15 @@ public static String getPrefix(Guild guild) {
return guild == null ? DEFAULT_PREFIX : RedisData.getSettings(guild).prefix;
}

public Collection<String> getCommandNames() {
Collection<String> names = new HashSet<>();
for (BotCommand command : registry) {
names.addAll(Arrays.asList(command.getAliases()));
names.add(command.getName());
}
return names;
}

public Collection<BotCommand> getCommands() {
return commands.values();
}
Expand Down Expand Up @@ -115,7 +124,8 @@ public void commandUser(User user, String command, Message message) {
).queue();
}
} else {
message.getTextChannel().sendMessage(MessageUtil.getErrorEmbed(message.getGuild(), "no_permission")).queue();
message.getTextChannel().sendMessage(MessageUtil.getErrorEmbed(message.getGuild(),
LanguageUtil.getString(message.getGuild(), Bundle.ERROR, "command"))).queue();
}
} else {
message.getChannel().sendMessage(new EmbedBuilder()
Expand Down

0 comments on commit 180831c

Please sign in to comment.