forked from sass/tipibot
Admin check now a dict
This commit is contained in:
@@ -7,13 +7,13 @@ import config
|
||||
|
||||
|
||||
def is_bot_admin(member: discord.abc.User | None) -> bool:
|
||||
"""True when the member has the configured admin role for their guild."""
|
||||
"""True when the member has any of the configured admin roles for their guild."""
|
||||
if not isinstance(member, discord.Member) or member.guild is None:
|
||||
return False
|
||||
role_id = config.BOT_ADMIN_ROLES.get(member.guild.id)
|
||||
if role_id is None:
|
||||
admin_role_ids = config.BOT_ADMIN_ROLES.get(member.guild.id)
|
||||
if not admin_role_ids:
|
||||
return False
|
||||
return any(r.id == role_id for r in member.roles)
|
||||
return any(r.id in admin_role_ids for r in member.roles)
|
||||
|
||||
|
||||
def bot_admin_check():
|
||||
|
||||
Reference in New Issue
Block a user