From e6563df50c2a388c16fc7222dc23b1c8bfb4f7f2 Mon Sep 17 00:00:00 2001 From: Raphael Nepomuceno Date: Wed, 2 May 2018 15:36:07 -0300 Subject: [PATCH] Fix IDs being strings on `bot.levels` setting. (#93) Now, numeric IDs on said configuration are converted to ints, regardless of the configuration format. --- disco/bot/bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/disco/bot/bot.py b/disco/bot/bot.py index 4088fea..eb2ff2e 100644 --- a/disco/bot/bot.py +++ b/disco/bot/bot.py @@ -186,8 +186,8 @@ class Bot(LoggingClass): self.add_plugin_module(plugin_mod) # Convert level mapping - for k, v in six.iteritems(self.config.levels): - self.config.levels[k] = CommandLevels.get(v) + for k, v in list(six.iteritems(self.config.levels)): + self.config.levels[int(k) if k.isdigit() else k] = CommandLevels.get(v) @classmethod def from_cli(cls, *plugins):