From a987a1405bad5c4e813c9b847d06ef62e1a13eae Mon Sep 17 00:00:00 2001 From: Mango0x45 Date: Thu, 25 Jun 2020 13:35:53 +0200 Subject: set_var now supports lists --- cogs/admin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cogs/admin.py b/cogs/admin.py index e03ce7d..1623f49 100755 --- a/cogs/admin.py +++ b/cogs/admin.py @@ -51,7 +51,6 @@ class Admin(commands.Cog): await ctx.send(f"Removed command {command}") - @commands.check(is_mod) @commands.command(name='reload', hidden=True, usage='') async def _reload(self, ctx, ext): @@ -205,6 +204,8 @@ class Admin(commands.Cog): @commands.command() async def setvar(self, ctx, key, *, value): with open('config.json', 'w') as f: + if value[0] == '[' and value[len(value)-1] == ']': + value = list(map(int, value[1:-1].split(','))) self.bot.config[str(ctx.message.guild.id)][key] = value json.dump(self.bot.config, f, indent=4) -- cgit v1.2.3