sharding (blacklists): Blacklist shard support.
Moved the `user_blacklist` and `guild_blacklist` to a client TTL cache.
This commit is contained in:
@@ -82,7 +82,7 @@ class LionModule(Module):
|
||||
raise SafeCancellation(details="Module '{}' is not ready.".format(self.name))
|
||||
|
||||
# Check global user blacklist
|
||||
if ctx.author.id in ctx.client.objects['blacklisted_users']:
|
||||
if ctx.author.id in ctx.client.user_blacklist():
|
||||
raise SafeCancellation(details='User is blacklisted.')
|
||||
|
||||
if ctx.guild:
|
||||
@@ -91,7 +91,7 @@ class LionModule(Module):
|
||||
raise SafeCancellation(details='Command channel is no longer reachable.')
|
||||
|
||||
# Check global guild blacklist
|
||||
if ctx.guild.id in ctx.client.objects['blacklisted_guilds']:
|
||||
if ctx.guild.id in ctx.client.guild_blacklist():
|
||||
raise SafeCancellation(details='Guild is blacklisted.')
|
||||
|
||||
# Check guild's own member blacklist
|
||||
|
||||
Reference in New Issue
Block a user