[V3 Core] local whitelist/blacklist (#1776)

* implements local whitelist/blacklist which had unused bot.db settings

This includes a role listing

* format pass

* Update core_commands.py

* .

* black format pass
This commit is contained in:
Michael H
2018-06-05 16:19:44 -04:00
committed by palmtree5
parent 0b78664792
commit 4aaef9558a
2 changed files with 175 additions and 2 deletions

View File

@@ -26,10 +26,12 @@ def init_global_checks(bot):
local_blacklist = await guild_settings.blacklist()
local_whitelist = await guild_settings.whitelist()
_ids = [r.id for r in ctx.author.roles if not r.is_default]
_ids.append(ctx.author.id)
if local_whitelist:
return ctx.author.id in local_whitelist
return any(i in local_whitelist for i in _ids)
return ctx.author.id not in local_blacklist
return not any(i in local_blacklist for i in _ids)
@bot.check
async def bots(ctx):