Role¶
discord_http.role module¶
- class discord_http.role.PartialRole(*, state, id, guild_id)¶
Bases:
PartialBase
- Parameters:
state (DiscordAPI)
id (int)
guild_id (int)
- async edit(*, name=<MISSING>, color=<MISSING>, colour=<MISSING>, hoist=<MISSING>, mentionable=<MISSING>, positions=<MISSING>, permissions=<MISSING>, unicode_emoji=<MISSING>, icon=<MISSING>, reason=None) Role ¶
Edit the role.
- Parameters:
color (
tuple
[Colour
|int
,...
] |Colour
|int
|None
) – Alias for colourcolour (
tuple
[Colour
|int
,...
] |Colour
|int
|None
) – The new colour of the role. If tuple is provided, it switches to the new gradient role colours. The third value must be one of the following: - 16761760 - 11127295 - 16759788hoist (
bool
|None
) – Whether the role should be displayed separately in the sidebarmentionable (
bool
|None
) – Whether the role should be mentionableunicode_emoji (
str
|None
) – The new unicode emoji of the rolepermissions (
Permissions
|None
) – The new permissions for the role
- Return type:
- Returns:
The edited role and its data
- Raises:
If both unicode_emoji and icon are set - If there were no changes applied to the role - If position was changed, but Discord API returned invalid data
- property guild: Guild | PartialGuild¶
Returns the guild this role is in.
- class discord_http.role.Role(*, state, guild, data)¶
Bases:
PartialRole
- Parameters:
state (DiscordAPI)
guild (Guild | PartialGuild)
data (dict)
Returns whether the role is a premium subscriber.
- Return type: