(Sysadmin): Add guild and user blacklist.

v2 -> v3 data migration for the blacklist tables.
Added blacklists and blacklist commands
Added bot admin level to help groups.
This commit is contained in:
2021-09-28 20:54:22 +03:00
parent b792b081b8
commit 9ae0de034f
14 changed files with 414 additions and 12 deletions

View File

@@ -1,4 +1,5 @@
from cmdClient import Command, Module
from cmdClient.lib import SafeCancellation
from meta import log
@@ -66,5 +67,15 @@ class LionModule(Module):
"""
Lion pre-command hook.
"""
# TODO: Add blacklist and auto-fetch of lion here.
...
# Check global guild blacklist
if ctx.guild.id in ctx.client.objects['blacklisted_guilds']:
raise SafeCancellation
# Check global user blacklist
if ctx.author.id in ctx.client.objects['blacklisted_users']:
raise SafeCancellation
if ctx.guild:
# Check guild's own member blacklist
if ctx.author.id in ctx.client.objects['ignored_members'][ctx.guild.id]:
raise SafeCancellation