Skip to content

Refactor VoiceRegion from hardcoded enum to dynamic class #3343

Description

@vmphase

Discussion on this started at #3289 and continued here.

VoiceRegion is currently a hardcoded enum, which requires a manual sync PR every time discord modifies their voice region list. Regions are actually fetchable dynamically via /voice/regions API endpoint. Hence there's no real need to hardcode a static list at all.

TL;DR on proposal:

  • Convert VoiceRegion to a regular object-like class returned by the API (id/name/optimal, etc.)
  • Add a compatibility layer so existing code like VoiceRegion.brazil keeps working (e.g. a metaclass with __getattr__ mapping legacy names to constructed instances, emitting a DeprecationWarning).

Metadata

Metadata

Assignees

Labels

Type

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions