Guild Leave error msg
This commit is contained in:
parent
dc91b47d20
commit
ab6edbf20c
2 changed files with 13 additions and 7 deletions
|
|
@ -16,6 +16,7 @@ public class GuildLeaveCommand implements Command {
|
|||
if (event.getConfig().getOwners().toString().contains(event.getAuthor().getId())) {
|
||||
if (args.length > 0) {
|
||||
Guild guild = event.getJDA().getGuildById(args[0]);
|
||||
try {
|
||||
guild.leave().queue();
|
||||
event.getTextChannel()
|
||||
.sendMessage(event.getMessageEditor()
|
||||
|
|
@ -23,6 +24,9 @@ public class GuildLeaveCommand implements Command {
|
|||
"", "commands.owner.guildleave.success.description", guild.getName())
|
||||
.build())
|
||||
.queue();
|
||||
} catch (Exception e) {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.WARNING, "commands.owner.guildleave.error.title", "", "commands.owner.guildleave.help.description", guild.getName()).build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,6 +202,8 @@ commands.owner.eval.help.description = Execute the given code
|
|||
commands.owner.eval.help.usage = <Code to execute>
|
||||
commands.owner.guildleave.success.title = Successfully left
|
||||
commands.owner.guildleave.success.description = I successfully left %extra%.
|
||||
commands.owner.guildleave.error.title = Can not leave
|
||||
commands.owner.guildleave.error.description = I can not leave from this guild. Maybe this isn't a ID?
|
||||
commands.owner.guildleave.help.description = Quit from a guild
|
||||
commands.owner.reboot.help.description = Restart the bot
|
||||
commands.owner.shutdown.success.title = Shutdown
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue