EmbeddedActivityState
Represents an embedded activity's state.
Attributes activity :
The embedded activity.
int
The respective channel's identifier.
int
The respective guild's identifier.
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
users
Methods
(...)
__new__Creates a new partial embedded activity state with the given fields.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
activity | The embedded activity. | |||
channel_id |
| The respective channel or its identifier. | ||
guild_id |
| The respective guild or its identifier. | ||
user_ids |
| The joined users' identifiers. |
Raises
TypeError
- If a parameter's value is incorrect.
ValueError
- If a parameter's type is incorrect.
()
copyCopies the embedded activity state.
Returns
new : instance<type<self>>
(...)
copy_withCopies the embedded activity state with the given fields.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
activity | The embedded activity. | |||
channel_id |
| The respective channel or its identifier. | ||
guild_id |
| The respective guild or its identifier. | ||
user_ids |
| 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.
(data, ...)
from_dataCreates a new embedded activity state from the given data.
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
data |
| Embedded activity data. | ||
guild_id |
|
| The guild's identifier where the activity is. |
Returns
self : instance<cls>
(data, ...)
from_data_is_createdCreates a new embedded activity state from the given data.
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
data |
| Embedded activity data. | ||
guild_id |
|
| The guild's identifier where the activity is. |
Returns
self : instance<cls>
is_created : bool
(...)
to_dataConverts the embedded activity state into it's json serializable representation.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
defaults |
|
| Whether fields with their default values should be included as well. |
Returns
data : dict
of (str
, object
) items
(data)
_difference_update_activityUpdates the activity of the embedded activity state and returns it's changed attributes.
Parameter | Type | Description |
---|---|---|
data |
| 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.
(data)
_difference_update_user_idsDifference updates the user id-s of the embedded activity state.
Parameter | Type | Description |
---|---|---|
data |
| 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.
(data, key)
_from_data_constructConstructs the embedded activity state from the given fields.
Parameter | Type | Description |
---|---|---|
data |
| Embedded activity data. |
key | Embedded activity key. |
Returns
self : instance<cls>
(data)
_update_activityUpdates the activity of the embedded activity state.
Parameter | Type | Description |
---|---|---|
data |
| Embedded activity state data. |
(data)
_update_user_idsUpdates the user id-s of the embedded activity state.
Parameter | Type | Description |
---|---|---|
data |
| 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.