mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
[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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user