discord_lfg.utils.roles
Create a standardised role.
logger = logging.getLogger(__name__)
module-attribute
#
RoleDefinition(name, count, emoji, identifier)
dataclass
#
create_roles_from_config(roles, role_counts)
#
Creates roles from a config input.
| PARAMETER | DESCRIPTION |
|---|---|
roles
|
A dictionary which has the following structure: { name: { emoji: emoji string, identifier: single-character indicator, } } |
role_counts
|
a lookup of role name to the count of the number of role spots for a command. |
| RETURNS | DESCRIPTION |
|---|---|
dict[str, RoleDefinition]
|
Dictionary of role name to definition |
Source code in src\discord_lfg\utils\roles.py
get_guild_role_mention_for_group_role(group_role, guild_roles, channel_name, channel_role_mentions)
#
Generates an expected role and retrieves this if it matches a real one.