aboutsummaryrefslogtreecommitdiff
path: root/cogs/admin.py
diff options
context:
space:
mode:
authorMango0x45 <thomasvoss@live.com>2020-07-24 15:05:04 +0000
committerMango0x45 <thomasvoss@live.com>2020-07-24 15:05:04 +0000
commit4bab18fd38f00549fdca8b4e0d2971cafa8413b3 (patch)
tree292874fabc37c4de612d47bbdc73a0718e64c0ae /cogs/admin.py
parent039775211ffec65ea3e6bab74a933756c903958c (diff)
downloadsteve-bot-4bab18fd38f00549fdca8b4e0d2971cafa8413b3.tar
steve-bot-4bab18fd38f00549fdca8b4e0d2971cafa8413b3.tar.gz
steve-bot-4bab18fd38f00549fdca8b4e0d2971cafa8413b3.tar.bz2
steve-bot-4bab18fd38f00549fdca8b4e0d2971cafa8413b3.tar.lz
steve-bot-4bab18fd38f00549fdca8b4e0d2971cafa8413b3.tar.xz
steve-bot-4bab18fd38f00549fdca8b4e0d2971cafa8413b3.tar.zst
steve-bot-4bab18fd38f00549fdca8b4e0d2971cafa8413b3.zip
Added blacklistvideo() and video_blacklist()
Diffstat (limited to 'cogs/admin.py')
-rwxr-xr-xcogs/admin.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/cogs/admin.py b/cogs/admin.py
index 3a6299f..8164790 100755
--- a/cogs/admin.py
+++ b/cogs/admin.py
@@ -237,6 +237,23 @@ class Admin(commands.Cog):
"""Print a config variable, use for testing"""
await ctx.send(self.bot.config[str(ctx.message.guild.id)][key])
+ @commands.command()
+ @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)
+ 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"""
+ message = '```The following URIs are blacklisted:\n'
+ for uri in self.bot.video_blacklist:
+ message += f'{uri}, '
+ await ctx.send(f'{message[:-2]}```')
def setup(bot):
bot.add_cog(Admin(bot))