VoiceRegion

Represents Discord's voice regions.

Attributes

custom : bool

Whether the voice region is custom (used for events, etc.).

deprecated : bool

Whether the voice region is deprecated.

name : str

The name of the voice region.

value : str

The unique identifier of the voice region.

vip : bool

Whether the voice region can be used only by guilds with VIP_REGIONS feature.

Class Attributes

DEFAULT_NAME : str = 'Undefined'

The default name of the voice regions.

INSTANCES : dict of (str, VoiceRegion) items

Stores the created VoiceRegion-s.

VALUE_TYPE : type = str

The voice regions' values' type.

Each predefined voice region is also stored as a class attribute:

Class attribute namevaluenamedeprecatedvipcustom
_deprecateddeprecateddeprecatedTrueFalseFalse
unknown'''unknown'FalseFalseFalse
brazilbrazilBrazilFalseFalseFalse
dubaidubaiDubaiFalseFalseFalse
eu_centraleu-centralCentral EuropeFalseFalseFalse
eu_westeu-westWestern EuropeFalseFalseFalse
europeeuropeEuropeFalseFalseFalse
hongkonghongkongHong KongFalseFalseFalse
indiaindiaIndiaFalseFalseFalse
japanjapanJapanFalseFalseFalse
russiarussiaRussiaFalseFalseFalse
singaporesingaporeSingaporeFalseFalseFalse
africa_southsouthafricaSouth AfricaFalseFalseFalse
sydneysydneySydneyFalseFalseFalse
us_centralus-centralUS CentralFalseFalseFalse
us_eastus-eastUS EastFalseFalseFalse
us_southus-southUS SouthFalseFalseFalse
us_westus-westUS WestFalseFalseFalse
amsterdamamsterdamAmsterdamTrueFalseFalse
frankfurtfrankfurtFrankfurtTrueFalseFalse
londonlondonLondonTrueFalseFalse
vip_us_eastvip-us-eastVIP US WestFalseTrueFalse
vip_us_westvip-us-westVIP US EastFalseTrueFalse
vip_amsterdamvip-amsterdamVIP AmsterdamTrueTrueFalse

Methods

__init__(value, name, deprecated, name, vip)

Creates a new voice region with the given parameters and stores it at the class's .INSTANCES.

ParameterTypeDescription
value

str

The unique identifier of the voice region.

name

str

The voice region's name.

deprecated

bool

Whether the voice region is deprecated.

name

str

The default name of the voice region.

vip

bool

Whether the voice region can be used only by guilds with VIP_REGIONS feature.

from_data(data)

Creates a voice region from the given data and stores it at the class's .INSTANCES.

If the voice region already exists returns that instead.

ParameterTypeDescription
data

dict of (str, object) items

Received voice region data.

Returns

self : VoiceRegion

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 voice region from the given id and stores it at class's .INSTANCES.

Called by .get when no voice region was found with the given id.

ParameterTypeDescription
value

str

The identifier of the voice region.

Returns

self : VoiceRegion

__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.