(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:
@@ -42,11 +42,14 @@ async def cmd_top(ctx):
|
||||
Lion.sync()
|
||||
|
||||
# Fetch the leaderboard
|
||||
exclude = [m.id for m in ctx.guild_settings.unranked_roles.members]
|
||||
exclude = set(m.id for m in ctx.guild_settings.unranked_roles.members)
|
||||
exclude.update(ctx.client.objects['blacklisted_users'])
|
||||
exclude.update(ctx.client.objects['ignored_members'][ctx.guild.id])
|
||||
|
||||
if exclude:
|
||||
user_data = tables.lions.select_where(
|
||||
guildid=ctx.guild.id,
|
||||
userid=data.NOT(exclude),
|
||||
userid=data.NOT(list(exclude)),
|
||||
select_columns=('userid', 'tracked_time'),
|
||||
_extra="AND tracked_time > 0 ORDER BY tracked_time DESC " + ("LIMIT 100" if top100 else "")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user