Presence Models#
- class interactions.api.models.presence.PresenceParty(kwargs_dict=None, /, **other_kwargs)[source]#
A class object representing the party data of a presence.
- class interactions.api.models.presence.PresenceAssets(kwargs_dict=None, /, **other_kwargs)[source]#
A class object representing the assets of a presence.
- class interactions.api.models.presence.PresenceSecrets(kwargs_dict=None, /, **other_kwargs)[source]#
A class object representing “secret” join information of a presence.
- class interactions.api.models.presence.PresenceTimestamp(kwargs_dict=None, /, **other_kwargs)[source]#
A class object representing the timestamp data of a presence.
- class interactions.api.models.presence.PresenceActivity(kwargs_dict=None, /, **other_kwargs)[source]#
A class object representing the current activity data of a presence.
Note
When using this model to instantiate alongside the client, if you provide a type
PresenceActivityType.STREAMING
, then theurl
attribute is necessary.The
button
attribute technically contains an object denoting Presence buttons. However, the gateway dispatches these as strings (of button labels) as bots don’t read the button URLs.- Variables:
name (str) – The activity name
type (Union[int, PresenceActivityType]) – The activity type
url (Optional[str]) – stream url (if type is
PresenceActivityType.STREAMING
)created_at (int) – Unix timestamp (in milliseconds) of when the activity was added to the user’s session
timestamps (Optional[PresenceTimestamp]) – Unix timestamps for start and/or end of the game
application_id (Optional[Snowflake]) – Application ID for the game
details (Optional[str]) – What the player is currently doing
state (Optional[str]) – Current party status
emoji (Optional[Emoji]) – The emoji used for the custom status
party (Optional[PresenceParty]) – Info for the current players’ party
assets (Optional[PresenceAssets]) – Images for the presence and their associated hover texts
secrets (Optional[PresenceSecrets]) – for RPC join/spectate
instance (Optional[bool]) – A status denoting if the activity is a game session
flags (Optional[int]) – activity flags
buttons (Optional[List[str]]) – Custom button labels shown in the status, if any.
- enum interactions.api.models.presence.PresenceActivityType(value)[source]#
A class object representing all supported Discord activity types.
- Member Type:
Valid values are as follows:
- GAME = <PresenceActivityType.GAME: 0>#
- STREAMING = <PresenceActivityType.STREAMING: 1>#
- LISTENING = <PresenceActivityType.LISTENING: 2>#
- WATCHING = <PresenceActivityType.WATCHING: 3>#
- CUSTOM = <PresenceActivityType.CUSTOM: 4>#
- COMPETING = <PresenceActivityType.COMPETING: 5>#
- class interactions.api.models.presence.ClientPresence(kwargs_dict=None, /, **other_kwargs)[source]#
An object that symbolizes the presence of the current client’s session upon creation.
- Variables:
since (Optional[int]) – Unix time in milliseconds of when the client went idle. None if it is not idle.
activities (Optional[List[PresenceActivity]]) – Array of activity objects.
status (Union[str, StatusType]) – The client’s new status.
afk (bool) – Whether the client is afk or not.