Update voice regions to handle new cloudflare regions #38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New cloudflare based endpoints have a new format that is not parseable by our current voice region parser (e.g "c-lhr14-eb603bad.discord.media:2096")
It seems to follow the pattern of "c-" + 3 letter IATA code, and there are a lot.
This PR adds a new field to the voice region enum that is a list of strings of all of the airport codes in the region of the existing region. There were still a ton of codes leftover that didn't match any existing regions, so I added some new generic ones that handle large amounts of these datacenter codes.
I have seen a few thousand of these and they all begin with c- which is why I chose to use that way of determining which to use.
The airport codes were translated to lat/long coordinates then those were just bucketed together based on general region. So it should be decently accurate but it's 2am and I haven't double checked them.
Also had the thought about making the discord IDs also a list and trimming down a bunch of these 1 city regions into countries at the very least but that could be a follow up.