From 8638b7525854d049e0fb6afe62b1c751dbb00fda Mon Sep 17 00:00:00 2001 From: anthorob Date: Fri, 18 Feb 2022 17:33:29 -0500 Subject: [PATCH] oopsy --- .../java/netneutrality/command/bot/ConfigureCommand.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/netneutrality/command/bot/ConfigureCommand.java b/src/main/java/netneutrality/command/bot/ConfigureCommand.java index 826f17a..27ef02e 100644 --- a/src/main/java/netneutrality/command/bot/ConfigureCommand.java +++ b/src/main/java/netneutrality/command/bot/ConfigureCommand.java @@ -56,13 +56,14 @@ public class ConfigureCommand extends AbstractCommand { public void execute(CommandContext context) { String[] args = context.getArgumentsAsArray(); MysqlDatabase database = DBController.get(); + GuildManager guildManager = GuildManager.getManager(context.getGuild()); if (args.length > 0) { if (context.getArg(0).equals("musicrole")) { if (args.length == 1) { - String roleDb = GuildManager.getManager(context.getGuild()).getSetting(GuildManager.GuildSetting.MUSIC_ROLE); + String roleDb = guildManager.getSetting(GuildManager.GuildSetting.MUSIC_ROLE); Role role = null; if (!roleDb.isEmpty()) { role = context.getGuild().getRoleById(roleDb); @@ -78,12 +79,14 @@ public class ConfigureCommand extends AbstractCommand { Role role = roles.get(0); if (role.getGuild().getId().equals(context.getGuild().getId())) { database.prepareAndExecuteAsync("UPDATE guild_settings SET music_role = ? WHERE guild_id = ?", role.getId(), context.getGuild().getId()).blocking(); + guildManager.reloadSettings(); context.reply("Successfully set %s as the role needed for music command", role.getAsMention()); } } if (context.getArg(1).equals("reset")) { database.prepareAndExecuteAsync("UPDATE guild_settings SET music_role = null WHERE guild_id = ?", context.getGuild().getId()).blocking(); + guildManager.reloadSettings(); context.reply("Successful reset of the role"); } }