EmbeddedActivityState

Represents an embedded activity's state.

Attributes

activity : Activity

The embedded activity.

channel_id : int

The respective channel's identifier.

guild_id : int

The respective guild's identifier.

user_ids : set of int

The joined users' identifiers.

Notes

Embedded activity state instances are weakreferable.

Properties

application_id

Returns the embedded activity's application's identifier.

Returns

application_id : int

channel

Returns the channel where the embedded activity is. The channel must be cached.

Returns

channel : Channel

guild

Returns the guild where the embedded activity is. The guild must be cached.

Returns

guild : None, Guild

key

Returns the key used to store the embedded activity in cache.

Returns

key : EmbeddedActivityStateKey

users

Returns the users of the embedded activity.

Returns

users : list of ClientUserBase

Methods

__new__(...)

Creates a new partial embedded activity state with the given fields.

ParameterTypeOptionalKeyword onlyDescription
activity

Activity

The embedded activity.

channel_id

int, Channel

The respective channel or its identifier.

guild_id

int, Guild

The respective guild or its identifier.

user_ids

None, iterable of (int, ClientUserBase)

The joined users' identifiers.

Raises

TypeError

  • If a parameter's value is incorrect.

ValueError

  • If a parameter's type is incorrect.

copy()

Copies the embedded activity state.

Returns

new : instance<type<self>>

copy_with(...)

Copies the embedded activity state with the given fields.

ParameterTypeOptionalKeyword onlyDescription
activity

Activity

The embedded activity.

channel_id

int, Channel

The respective channel or its identifier.

guild_id

int, Guild

The respective guild or its identifier.

user_ids

None, iterable of (int, ClientUserBase)

The joined users' identifiers.

Returns

new : instance<type<self>>

Raises

TypeError

  • If a parameter's value is incorrect.

ValueError

  • If a parameter's type is incorrect.

from_data(data, ...)

Creates a new embedded activity state from the given data.

ParameterTypeOptionalDefaultDescription
data

dict of (str, object) items

Embedded activity data.

guild_id

int

0

The guild's identifier where the activity is.

Returns

self : instance<cls>

from_data_is_created(data, ...)

Creates a new embedded activity state from the given data.

ParameterTypeOptionalDefaultDescription
data

dict of (str, object) items

Embedded activity data.

guild_id

int

0

The guild's identifier where the activity is.

Returns

self : instance<cls> is_created : bool

to_data(...)

Converts the embedded activity state into it's json serializable representation.

ParameterTypeOptionalKeyword onlyDefaultDescription
defaults

bool

False

Whether fields with their default values should be included as well.

Returns

data : dict of (str, object) items

_difference_update_activity(data)

Updates the activity of the embedded activity state and returns it's changed attributes.

ParameterTypeDescription
data

dict of (str, object) items

Embedded activity state data.

Returns

old_attributes : dict of (str, object) items

The old attributes of the activity, that were modified. Check Activity._difference_update_attributes for the exact fields.

_difference_update_user_ids(data)

Difference updates the user id-s of the embedded activity state.

ParameterTypeDescription
data

dict of (str, object) items

Embedded activity state data.

Returns

joined_user_ids : set of int

The joined users' identifiers.

left_user_ids : set of int

The left users' identifiers.

_from_data_construct(data, key)

Constructs the embedded activity state from the given fields.

ParameterTypeDescription
data

dict of (str, object) items

Embedded activity data.

key

EmbeddedActivityStateKey

Embedded activity key.

Returns

self : instance<cls>

_update_activity(data)

Updates the activity of the embedded activity state.

ParameterTypeDescription
data

dict of (str, object) items

Embedded activity state data.

_update_user_ids(data)

Updates the user id-s of the embedded activity state.

ParameterTypeDescription
data

dict of (str, object) items

Embedded activity state data.

__eq__()

Returns whether the two embedded activities are the same.

__getattr__()

Drops a rich attribute error.

__hash__()

Returns the hash value of the embedded activity state.

__repr__()

Returns the embedded activity's representation.