sidequest_bot.lib.roles#
Rules for roles the bot hands out on its own (level rewards, auto-role, self-serve role menus).
Two independent checks, both required:
grant_block_reason()- is the role itself safe for the bot to give away? Checked when the role is configured AND again right before every grant, because an admin can add permissions to a role after it was configured.configure_block_reason()- may this member set the role up to be handed out? Without it, anyone with Manage Server could configure a role above their own and escalate through the bot’s permissions.
Attributes#
Permissions a role must not carry if the bot grants it automatically or on request. |
Functions#
|
Why |
|
Names of the dangerous permissions set in |
|
Why the bot must not hand out |
Module Contents#
- sidequest_bot.lib.roles.configure_block_reason(member: discord.Member, role: discord.Role) str | None#
Why
membermay not configureroleto be handed out by the bot, or None if they may.Requires Manage Roles and that the role sits below the member’s highest role (the server owner is exempt).
- sidequest_bot.lib.roles.dangerous_permissions(permissions: discord.Permissions) list[str]#
Names of the dangerous permissions set in
permissions, sorted.
- sidequest_bot.lib.roles.grant_block_reason(role: discord.Role) str | None#
Why the bot must not hand out
roleautomatically, or None if it may.
- sidequest_bot.lib.roles.DANGEROUS_PERMISSIONS#
Permissions a role must not carry if the bot grants it automatically or on request.