From 2a0c44c7da643a4b27b3bbd5327e125658d7488a Mon Sep 17 00:00:00 2001 From: Mango0x45 Date: Sun, 23 Aug 2020 14:14:25 +0200 Subject: Blacklisted videos are now stored by ID instead of URI --- cogs/admin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cogs/admin.py') diff --git a/cogs/admin.py b/cogs/admin.py index 014d4cb..c023cd4 100755 --- a/cogs/admin.py +++ b/cogs/admin.py @@ -292,15 +292,18 @@ class Admin(commands.Cog): async def delvar(self, ctx, key): """Deletes a config variable, be careful""" with open('config.json', 'w') as f: - await ctx.send(f"Removed {self.bot.config[str(ctx.message.guild.id)].pop(key)}") + await ctx.send( + f"Removed {self.bot.config[str(ctx.message.guild.id)].pop(key)}" + ) json.dump(self.bot.config, f, indent=4) @commands.command() @commands.check(is_mod) async def blacklistvideo(self, ctx, uri): """Set runs from a specific url to be auto rejected""" + video_id = uri.split('/')[-1] with open('runs_blacklist.json', 'w') as f: - self.bot.runs_blacklist["videos"].append(uri) + self.bot.runs_blacklist["videos"].append(video_id) json.dump(self.bot.runs_blacklist, f, indent=4) await ctx.send(f'Blacklisted runs from `{uri}`') -- cgit v1.2.3