ActivityType

Represents an Activity 's type.

Attributes

metadata_type : type<ActivityMetadataBase>

The activity type's respective metadata type.

name : str

The default name of the activity type.

value : int

The Discord side identifier value of the activity type.

Class Attributes

DEFAULT_NAME : str = 'Undefined'

The default name of the activity types.

INSTANCES : dict of (str, ActivityType) items

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.

VALUE_TYPE : type = str

The activity types' values' type.

Every predefined activity type is also stored as a class attribute:

Class attribute nameNameValueMetadata type
unknownunknown-1ActivityMetadataBase
gamegame0ActivityMetadataRich
streamblock stream1ActivityMetadataRich
spotifyspotify2ActivityMetadataRich
watchingwatching3ActivityMetadataRich
customcustom4ActivityMetadataCustom
competingcompeting5ActivityMetadataRich

Methods

__init__(value, name, metadata_type)

Creates an ActivityType and stores it at the class's .INSTANCES class attribute as well.

ParameterTypeDescription
value

int

The Discord side identifier value of the activity type.

name

str

The default name of the activity type.

metadata_type

None, type<ActivityMetadataBase>

The activity type's respective metadata type.

get(value)

Returns the value's representation. If the value is already preinstanced, returns that, else creates a new object.

ParameterTypeDescription
value

None, .VALUE_TYPE

The value to get it's representation.

Returns

obj_ : PreinstancedBase

_from_value(value)

Creates a new activity type with the given value.

ParameterTypeDescription
value

int

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.