curious.dataclasses.role¶
Wrappers for Role objects.
Classes
Role (client, **kwargs) |
Represents a role on a server. |
-
class
curious.dataclasses.role.
Role
(client, **kwargs) → None[source]¶ Bases:
curious.dataclasses.bases.Dataclass
Represents a role on a server.
Inspects the stack to ensure we’re being called correctly.
-
allow_mentions
()[source]¶ Temporarily allows this role to be mentioned during.
async with role.allow_mentions(): await ctx.channel.messages.send(role.mention)
Return type: _MentionableRole
-
await
assign_to
(member)[source]¶ Assigns this role to a member.
See also
Parameters: member ( Member
) – TheMember
to assign to.Return type: Role
-
await
edit
(*, name=None, permissions=None, colour=None, position=None, hoist=None, mentionable=None)[source]¶ Edits this role.
Parameters: - name (
Optional
[str
]) – The name of the role. - permissions (
Optional
[Permissions
]) – The permissions that the role has. - colour (
Optional
[int
]) – The colour of the role. - position (
Optional
[int
]) – The position in the sorting list that the role has. - hoist (
Optional
[bool
]) – Is this role hoisted (shows separately in the role list)? - mentionable (
Optional
[bool
]) – Is this mentionable by everyone?
Return type: - name (
-
mention
¶ Gets the string that can be used to mention this role.
Warning
If
Role.mentionable
isFalse
, this will not actually mention the role.Return type: str
-