Merge Greg's branch into the master branch #230

Merged
greg6775 merged 39 commits from greg-dev into master 2019-12-21 18:14:56 +01:00
2 changed files with 13 additions and 7 deletions
Showing only changes of commit ab6edbf20c - Show all commits

View file

@ -16,13 +16,17 @@ 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]);
guild.leave().queue();
event.getTextChannel()
.sendMessage(event.getMessageEditor()
.getMessage(MessageEditor.MessageType.INFO, "commands.owner.guildleave.success.title",
"", "commands.owner.guildleave.success.description", guild.getName())
.build())
.queue();
try {
guild.leave().queue();
event.getTextChannel()
.sendMessage(event.getMessageEditor()
.getMessage(MessageEditor.MessageType.INFO, "commands.owner.guildleave.success.title",
"", "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);
}

View file

@ -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