ClientCompoundRoleEndpoints
Methods
()
__new__Compound components do not support instancing.
Sub-typing is supported, but the attributes are only proxied. Sub-types have no meaning by themselves.
Raises
RuntimeError
(guild)
guild_role_get_allRequests the given guild's roles and if there any de-sync between the wrapper and Discord, applies the changes.
This method is a coroutine.
Parameter | Type | Description |
---|---|---|
guild |
| The guild, what's roles will be requested. |
Returns
roles : list
of Role
Raises
TypeError
If guild
was not given neither as Guild
, nor as int
.
ConnectionError
No internet connection.
DiscordException
If any exception was received from the Discord API.
()
guild_sync(guild, ...)
role_createCreates a role at the given guild.
This method is a coroutine.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
guild |
| The guild where the role will be created. | |||
role_template |
|
| Role entity to use as a template. | ||
reason |
|
| Shows up at the guild's audit logs. | ||
**keyword_parameters | Keyword parameters | Additional keyword parameters to create the role with. | |||
color |
| The role's color. | |||
flags |
| The role's flags. | |||
icon |
| The role's icon. | |||
mentionable |
| Whether the role can be mentioned. | |||
name |
| The role's name. | |||
permissions |
| The permissions of the users having the role. | |||
position |
| The role's position. | |||
separated |
| Users show up in separated groups by their highest | |||
unicode_emoji |
| The role's icon as an unicode emoji. |
Raises
TypeError
- If a parameter's type is incorrect.
ValueError
- If a parameter's value is incorrect.
ConnectionError
No internet connection.
DiscordException
If any exception was received from the Discord API.
(role, ...)
role_deleteDeletes the given role.
This method is a coroutine.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
role |
| The role to delete | |||
reason |
|
| Shows up at the respective guild's audit logs. |
Raises
TypeError
If role
was not given neither as Role
nor as tuple
of (int
, int
).
ConnectionError
No internet connection.
DiscordException
If any exception was received from the Discord API.
(role, ...)
role_editEdits the role with the given parameters.
This method is a coroutine.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
role |
| The role to edit. | |||
role_template |
|
| Role entity to use as a template. | ||
reason |
|
| Shows up at the guild's audit logs. | ||
**keyword_parameters | Keyword parameters | Additional keyword parameters to edit the role with. | |||
color |
| The role's color. | |||
flags |
| The role's flags. | |||
icon |
| The role's icon. | |||
mentionable |
| Whether the role can be mentioned. | |||
name |
| The role's name. | |||
permissions |
| The permissions of the users having the role. | |||
position |
| The role's position. | |||
separated |
| Users show up in separated groups by their highest | |||
unicode_emoji |
| The role's icon as an unicode emoji. |
Raises
TypeError
- If a parameter's type is incorrect.
ValueError
- If a parameter's value is incorrect.
ConnectionError
No internet connection.
DiscordException
If any exception was received from the Discord API.
(role, position, ...)
role_moveMoves the given role.
This method is a coroutine.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
role |
| The role to move. | |||
position |
| The position to move the given role. | |||
reason |
|
| Shows up at the respective guild's audit logs. |
Raises
TypeError
If role
was not given neither as Role
nor as tuple
of (int
, int
).
ValueError
- If default role would be moved.
- If any role would be moved to position
0
.
ConnectionError
No internet connection.
DiscordException
If any exception was received from the Discord API.
(roles, ...)
role_reorderMoves more roles at their guild to the specific positions.
Partial roles are ignored and if passed any, every role's position after it is reduced. If there are roles passed with different guilds, then ValueError
will be raised. If there are roles passed with the same position, then their positions will be sorted out.
This method is a coroutine.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
roles | ( | A | |||
reason |
|
| Shows up at the respective guild's audit logs. |
Raises
TypeError
If roles
's format is not any of the expected ones.
ValueError
- If default role would be moved.
- If any role would be moved to position
0
. - If roles from more guilds are passed.
ConnectionError
No internet connection.
DiscordException
If any exception was received from the Discord API.
(item)
_role_reorder_roles_element_validatorValidates a role-position pair.
This method is a coroutine.
Parameter | Type | Description |
---|---|---|
item |
| A |
Yields
item : None
, tuple
(Role
, Guild
, int
)
Returns
role : Role
The validated role.
guild : None, Guild
The role's guild.
Raises
TypeError
If item
has invalid format.
(roles)
_role_reorder_roles_validatorValidates roles
parameter of .role_reorder
.
This method is an asynchronous generator.
Parameter | Type | Description |
---|---|---|
roles | ( | A |
Yields
item : None
, tuple
(Role
, Guild
, int
)
Raises
TypeError
If roles
's format is not any of the expected ones.