Status

Represents a Discord user's status.

Attributes

name : str

The status's name.

position : int

Internal position of the status for sorting purposes.

value : str

The identifier value of the status.

Class Attributes

DEFAULT_NAME : str = ''

The default name of the statuses. Statuses sue their value as names, so this field is not used.

DEFAULT_POSITION : int = 5

The default position of the statuses'.

INSTANCES : dict of (str, Status) items

A container what stores the predefined statuses in value- status relation. This container is accessed when translating status value to Status object.

VALUE_TYPE : type = str

The statuses' values' type.

Each predefined status also can be accessed as a class attribute:

Class attribute namepositionvalue
online0idle
idle1idle
dnd2dnd
offline3offline
invisible3invisible

Methods

__init__(value, name, position)

Creates a new status and stores it at the class's .INSTANCES class attribute.

ParameterTypeDescription
value

str

The identifier value of the status.

name

str

The status's name.

position

int

Internal position of the status for sorting purposes.

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 status object from the given value.

ParameterTypeDescription
value

.VALUE_TYPE

The value what has no representation yet.

Returns

self : Status

The created status.

__eq__()

Returns whether the two status is equal.

__ge__()

Returns whether this status's position is greater than the other's or whether the two status is equal.

__getattr__()

Drops a rich attribute error.

__gt__()

Returns whether this status's position is greater than the other's.

__hash__()

Returns the status's hash value.

__le__()

Returns whether this status's position is less than the other's or whether the two status is equal.

__lt__()

Returns whether this status's position is less than the other's.

__ne__()

Returns whether the two status is not equal.

__repr__()

Returns the representation of the status.