Member¶
discord_http.member module¶
- class discord_http.member.Member(*, state, guild, data)¶
Bases:
PartialMember
- Parameters:
state (DiscordAPI)
guild (Guild | PartialGuild)
data (dict)
- property discriminator: str | None¶
Gives the discriminator of the member if available.
- Returns:
Discriminator of a user who has yet to convert or a bot account.
If the user has converted to the new username, this will return None
- get_role(role) PartialRole | None ¶
Get a role from the member.
- property guild_permissions: Permissions¶
Returns the guild permissions of the member.
This is only available if you are using gateway with guild cache.
- has_permissions(*args) bool ¶
Check if a member has a permission.
Will be False if used in Member.fetch() every time
- property resolved_permissions: Permissions¶
Permissions Returns permissions from an interaction.
Will always be Permissions.none() if used in Member.fetch()
- property roles: list[Role | PartialRole]¶
Returns the roles of the member.
- property top_role: PartialRole | Role | None¶
Returns the top role of the member.
Only usable if you are using gateway and caching
- class discord_http.member.PartialMember(*, state, id, guild_id)¶
Bases:
PartialBase
- Parameters:
state (DiscordAPI)
id (int)
guild_id (int)
- async add_roles(*roles, reason=None) None ¶
Add roles to someone.
- Parameters:
*roles (
PartialRole
|int
) – Roles to add to the member
- Return type:
- async ban(*, reason=None, delete_message_days=0, delete_message_seconds=0) None ¶
Ban the user.
- Parameters:
- Raises:
If delete_message_days and delete_message_seconds are both specified - If delete_message_days is not between 0 and 7 - If delete_message_seconds is not between 0 and 604,800
- Return type:
- async edit(*, nick=<MISSING>, roles=<MISSING>, mute=<MISSING>, deaf=<MISSING>, communication_disabled_until=<MISSING>, channel_id=<MISSING>, reason=None) Member ¶
Edit the member.
- Parameters:
- Return type:
- Returns:
The edited member
- Raises:
If communication_disabled_until is not timedelta, datetime, or int
- property guild: Guild | PartialGuild¶
The guild of the member.
If you are using gateway cache, it can return full object too
- async remove_roles(*roles, reason=None) None ¶
Remove roles from someone.
- Parameters:
*roles (
PartialRole
|int
) – Roles to remove from the member
- Return type:
- async send(content=<MISSING>, *, channel_id=<MISSING>, embed=<MISSING>, embeds=<MISSING>, file=<MISSING>, files=<MISSING>, view=<MISSING>, tts=False, type=4, flags=<MISSING>, allowed_mentions=<MISSING>, delete_after=None) Message ¶
Send a message to the user.
- Parameters:
channel_id (
int
|None
) – Channel ID of the user, leave empty to create a DMtts (
bool
|None
) – Whether the message should be sent as TTStype (
ResponseType
|int
) – Type of the messageflags (
MessageFlags
|None
) – Flags of the messageallowed_mentions (
AllowedMentions
|None
) – Allowed mentions of the messagedelete_after (
float
|None
) – How long to wait before deleting the message
- Return type:
- Returns:
The message sent
- class discord_http.member.ThreadMember(*, state, guild, data) None ¶
Bases:
Member
- Parameters:
state (DiscordAPI)
guild (PartialGuild)
data (dict)
- property thread: PartialChannel | Thread¶
The thread the member is in.