tzhf / chatguessr

A Twitch chatbot for GeoGuessr.
https://chatguessr.com
MIT License
43 stars 13 forks source link

Split country flags and non-country flags, add more unicode flags #17

Closed ReAnnannanna closed 2 years ago

ReAnnannanna commented 2 years ago

This moves the flags for non-countries / subdivisions into a new file, builtinFlags.json, which has a custom emoji field for display in chat messages. The state flags will now show as "🇺🇸 (AK)" with the state abbreviation instead of as image. countryCodesNames.json now only contains country codes recognised by Unicode.

In addition the builtinFlags.json file lets us add some other flags that have Unicode support but are not countries. This includes the white flag, pirate flag and some pride flags, I think these would be nice to have. now people can finally do !flag surrender :P

With these changes all the flags can be treated in the same way, as they are all objects with { code, names, emoji } properties, and we don't need to specialcase country flags in getEmoji() for example.