ActivityType
Represents an Activity
's type.
Attributes
type<ActivityMetadataBase>
The activity type's respective metadata type.
str
The default name of the activity type.
int
The Discord side identifier value of the activity type.
Class Attributes
str
= 'Undefined'
The default name of the activity types.
Stores the predefined activity types. This container is accessed when translating a Discord side identifier of a activity type. The identifier value is used as a key to get it's wrapper side representation.
type
= str
The activity types' values' type.
Every predefined activity type is also stored as a class attribute:
Class attribute name | Name | Value | Metadata type |
---|---|---|---|
unknown | unknown | -1 | ActivityMetadataBase |
game | game | 0 | ActivityMetadataRich |
stream | block stream | 1 | ActivityMetadataRich |
spotify | spotify | 2 | ActivityMetadataRich |
watching | watching | 3 | ActivityMetadataRich |
custom | custom | 4 | ActivityMetadataCustom |
competing | competing | 5 | ActivityMetadataRich |
Methods
(value, name, metadata_type)
__init__Creates an ActivityType
and stores it at the class's .INSTANCES
class attribute as well.
Parameter | Type | Description |
---|---|---|
value |
| The Discord side identifier value of the activity type. |
name |
| The default name of the activity type. |
metadata_type |
| The activity type's respective metadata type. |
(value)
getReturns the value's representation. If the value is already preinstanced, returns that, else creates a new object.
Parameter | Type | Description |
---|---|---|
value |
| The value to get it's representation. |
Returns
obj_ : PreinstancedBase
(value)
_from_valueCreates a new activity type with the given value.
Parameter | Type | Description |
---|---|---|
value |
| The activity type's identifier value. |
Returns
self : instance<cls>
The created instance.
()
__eq__Returns whether self's value equals to the other object's.
()
__ge__Returns whether self's value is greater or equal to the other object's.
()
__getattr__Drops a rich attribute error.
()
__gt__Returns whether self's value is greater than the other object's.
()
__hash__Returns the hash of the preinstanced object.
()
__le__Returns whether self's value is less or equal to the other object's.
()
__lt__Returns whether self's value is less than the other object's.
()
__ne__Returns whether self's not equals to the other object's.
()
__repr__Returns the representation of the preinstanced object.