User¶
discord_http.user module¶
- class discord_http.user.Application(*, state, data)¶
Bases:
PartialBaseRepresents a user client object.
- Parameters:
state (DiscordAPI)
data (dict)
- verified¶
- guild_id: int | None¶
The ID of the guild of the application, if the application is a game sold on Discord.
- primary_sku_id: int | None¶
The ID of the primary SKU of the application, if the application is a game sold on Discord.
- flags: ApplicationFlags¶
The flags of the application.
- approximate_guild_count: int | None¶
The approximate number of guilds the application is in, if the application is a game sold on Discord.
- approximate_user_install_count: int | None¶
The approximate number of users that have the application installed.
- approximate_user_authorization_count: int | None¶
The approximate number of users that have authorized the application.
- role_connections_verification_url: str | None¶
The role connections verification URL of the application, if any.
- event_webhooks_status: ApplicationEventWebhookStatus¶
The event webhooks status of the application.
- property owner: PartialUser | None¶
The owner of the application, if any.
- property guild: PartialGuild | None¶
The guild of the application, if the application is a game sold on Discord.
- property primary_sku: PartialSKU | None¶
The primary SKU of the application, if the application is a game sold on Discord.
- async edit(*, custom_install_url=<MISSING>, description=<MISSING>, role_connections_verification_url=<MISSING>, install_params=<MISSING>, integration_types_config=<MISSING>, flags=<MISSING>, icon=<MISSING>, cover_image=<MISSING>, interactions_endpoint_url=<MISSING>, tags=<MISSING>, event_webhooks_url=<MISSING>, event_webhooks_status=<MISSING>, event_webhooks_types=<MISSING>) Application¶
Edit the current application.
Only limited intent flags can be updated through flags.
- Parameters:
custom_install_url (
str|None) – New custom install URL of the applicationdescription (
str|None) – New description of the applicationrole_connections_verification_url (
str|None) – New role connections verification URL of the applicationinstall_params (
dict|None) – New install params of the applicationintegration_types_config (
dict|None) – New integration types config of the applicationflags (
ApplicationFlags|int|None) – New flags of the applicationcover_image (
File|bytes|None) – New cover image of the applicationinteractions_endpoint_url (
str|None) – New interactions endpoint URL of the applicationevent_webhooks_url (
str|None) – New event webhooks URL of the applicationevent_webhooks_status (
ApplicationEventWebhookStatus|int|None) – New event webhooks status of the applicationevent_webhooks_types (
list[str] |None) – New event webhooks types of the application
- Return type:
- Returns:
The edited application
- async fetch_role_connection_metadata() list[ApplicationRoleConnectionMetadata]¶
Fetches the role connection metadata records for the application.
- Return type:
- async edit_role_connection_metadata(records) list[ApplicationRoleConnectionMetadata]¶
Updates the role connection metadata records for the application.
- Parameters:
records (
list[ApplicationRoleConnectionMetadata]) – The new metadata records for the application (max 5)- Return type:
- Returns:
The updated metadata records
- class discord_http.user.ApplicationRoleConnectionMetadata(*, type, key, name, description, name_localizations=None, description_localizations=None)¶
Bases:
objectRepresents a single application role connection metadata record.
- Parameters:
- type: ApplicationRoleConnectionMetadataType¶
The type of comparison the metadata value is checked against.
- description_localizations: dict[str, str]¶
The localizations of the description of the metadata field.
- classmethod from_dict(data) ApplicationRoleConnectionMetadata¶
Creates an ApplicationRoleConnectionMetadata from a dict provided by Discord.
- Return type:
- Parameters:
data (dict)
- class discord_http.user.AvatarDecoration(state, data)¶
Bases:
SnowflakeRepresents an avatar decoration of a user.
- Parameters:
state (DiscordAPI)
data (dict)
- asset¶
The asset of the avatar decoration.
- class discord_http.user.DisplayNameStyles(data)¶
Bases:
objectRepresents the display name style of a user.
Warning
This is not officially documented by Discord, things can change.
- Parameters:
data (dict)
- font: DisplayNameFontType¶
The font of the display name, if any.
- effect: DisplayNameEffectType¶
The effect of the display name, if any.
- classmethod create(*, colours, font, effect) DisplayNameStyles¶
Creates a display name style object.
Used to easily have an object to pass to the API when editing the application’s display name style.
- Parameters:
colours (
list[Colour] |Colour) – The colors of the display name, if any.font (
DisplayNameFontType) – The font of the display name, if any.effect (
DisplayNameEffectType) – The effect of the display name, if any.
- Return type:
- Returns:
The display name style object.
- class discord_http.user.Nameplate(state, data)¶
Bases:
objectRepresents a nameplate collectible of a user.
- Parameters:
state (DiscordAPI)
data (dict)
- property sku: PartialSKU¶
The partial SKU associated with the nameplate.
- class discord_http.user.PartialUser(*, state, id)¶
Bases:
PartialBaseRepresents a partial user object.
- Parameters:
state (DiscordAPI)
id (int)
- 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 to send the message to, if not provided, it will create a DM channeltts (
bool|None) – Whether the message should be sent as TTStype (
ResponseType|int) – Which type of response should be sentflags (
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 that was sent
- class discord_http.user.PrimaryGuild(state, data)¶
Bases:
objectRepresents a primary guild of a user.
This is commonly known as ‘clan’.
- Parameters:
state (DiscordAPI)
data (dict)
- guild() Guild | PartialGuild | None¶
Returns the guild object.
- Return type:
Guild|PartialGuild|None
- class discord_http.user.Team(*, state, data)¶
Bases:
PartialBaseRepresents a Discord developer team.
- Parameters:
state (DiscordAPI)
data (dict)
- members: list[TeamMember]¶
The members of the team.
- property owner: PartialUser¶
The user that owns the team.
- class discord_http.user.TeamMember(*, state, team_id, data)¶
Bases:
PartialBaseRepresents a member of a developer team.
- Parameters:
state (DiscordAPI)
team_id (int)
data (dict)
- membership_state: TeamMembershipState¶
The membership state of the team member.
- class discord_http.user.User(*, state, data)¶
Bases:
PartialUserRepresents a user object.
- Parameters:
state (DiscordAPI)
data (dict)
- property avatar_decoration: AvatarDecoration | None¶
The avatar decoration of the member, if available.
- property name_style: DisplayNameStyles | None¶
The display name style of the user, if any.
- property primary_guild: PrimaryGuild | None¶
The primary guild of the user (aka. clan), if any.
- property display_name_style: DisplayNameStyles | None¶
An alias to merge with Member.display_name_style.
- property display_avatar_decoration: AvatarDecoration | None¶
An alias to merge with Member.display_avatar_decoration.
- property global_avatar_decoration: AvatarDecoration | None¶
Alias for User.avatar_decoration.
- async edit(*, username=<MISSING>, avatar=<MISSING>, banner=<MISSING>) User¶
Edit the user (only works for the current bot).
- 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 to send the message to, if not provided, it will create a DM channeltts (
bool|None) – Whether the message should be sent as TTStype (
ResponseType|int) – Which type of response should be sentflags (
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 that was sent