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).
Discussion on this started at #3289 and continued here.
VoiceRegionis 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:
VoiceRegionto a regular object-like class returned by the API (id/name/optimal, etc.)VoiceRegion.brazilkeeps working (e.g. a metaclass with__getattr__mapping legacy names to constructed instances, emitting aDeprecationWarning).