diff options
author | Mango0x45 <thomasvoss@live.com> | 2020-07-29 09:02:57 +0000 |
---|---|---|
committer | Mango0x45 <thomasvoss@live.com> | 2020-07-29 09:02:57 +0000 |
commit | 9d2497a1a887d57435e1a2bc46df2311fdd38881 (patch) | |
tree | 8226d56cf7f541ae3493180d8899a04bfd9d2506 /cogs/admin.py | |
parent | ab51bc9633bae052405a9c3d8eb0d7a5ca79780b (diff) | |
download | steve-bot-9d2497a1a887d57435e1a2bc46df2311fdd38881.tar steve-bot-9d2497a1a887d57435e1a2bc46df2311fdd38881.tar.gz steve-bot-9d2497a1a887d57435e1a2bc46df2311fdd38881.tar.bz2 steve-bot-9d2497a1a887d57435e1a2bc46df2311fdd38881.tar.lz steve-bot-9d2497a1a887d57435e1a2bc46df2311fdd38881.tar.xz steve-bot-9d2497a1a887d57435e1a2bc46df2311fdd38881.tar.zst steve-bot-9d2497a1a887d57435e1a2bc46df2311fdd38881.zip |
Autoreject runs from banned players
Diffstat (limited to '')
-rwxr-xr-x | cogs/admin.py | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/cogs/admin.py b/cogs/admin.py index e1ed9bf..9b35be0 100755 --- a/cogs/admin.py +++ b/cogs/admin.py @@ -241,19 +241,33 @@ class Admin(commands.Cog): @commands.check(is_mod) async def blacklistvideo(self, ctx, uri): """Set runs from a specific url to be auto rejected""" - with open('video_blacklist.json', 'w') as f: - self.bot.video_blacklist.append(uri) + with open('runs_blacklist.json', 'w') as f: + self.bot.video_blacklist["videos"].append(uri) json.dump(self.bot.video_blacklist, f, indent=4) await ctx.send(f'Blacklisted runs from `{uri}`') @commands.command() @commands.check(is_mod) - async def video_blacklist(self, ctx): - """Sends a list of blacklisted uris""" + async def blacklistplayer(self, ctx, player): + """Set runs from a specific player to be auto rejected""" + with open('runs_blacklist.json', 'w') as f: + self.bot.video_blacklist["players"].append(uri) + json.dump(self.bot.video_blacklist, f, indent=4) + await ctx.send(f'Blacklisted runs from `{player}`') + + @commands.command() + @commands.check(is_mod) + async def runs_blacklist(self, ctx): + """Sends a list of blacklisted videos and players""" message = '```The following URIs are blacklisted:\n' - for uri in self.bot.video_blacklist: + for uri in self.bot.runs_blacklist["videos"]: message += f'{uri}, ' await ctx.send(f'{message[:-2]}```') + message = '```The following players are blacklisted:\n' + for player in self.bot.runs_blacklist["players"]: + message += f'{player}, ' + await ctx.send(f'{message[:-2]}```') + def setup(bot): bot.add_cog(Admin(bot)) |