aboutsummaryrefslogtreecommitdiff
path: root/cogs/admin.py
diff options
context:
space:
mode:
authorAnInternetTroll <lucafulger@gmail.com>2020-07-27 18:24:49 +0000
committerAnInternetTroll <lucafulger@gmail.com>2020-07-27 18:24:49 +0000
commit27c6a4a11ecfecfc5c989c96d9b236e89faf5984 (patch)
tree6051f1725c70651ddc326f2c395ee0af0cd3286f /cogs/admin.py
parentfd4212d1a930aa72a84d8d380e22c3d89f206130 (diff)
parent85779b58d4b3b4b37ead36a68c8beacf0e2c554e (diff)
downloadsteve-bot-27c6a4a11ecfecfc5c989c96d9b236e89faf5984.tar
steve-bot-27c6a4a11ecfecfc5c989c96d9b236e89faf5984.tar.gz
steve-bot-27c6a4a11ecfecfc5c989c96d9b236e89faf5984.tar.bz2
steve-bot-27c6a4a11ecfecfc5c989c96d9b236e89faf5984.tar.lz
steve-bot-27c6a4a11ecfecfc5c989c96d9b236e89faf5984.tar.xz
steve-bot-27c6a4a11ecfecfc5c989c96d9b236e89faf5984.tar.zst
steve-bot-27c6a4a11ecfecfc5c989c96d9b236e89faf5984.zip
Merge branch 'master' of github.com:AnInternetTroll/mcbeDiscordBot
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))