A re-imagining of https://github.com/kayteh/medkit-bot
Currently it changes some channel names in Discord based on server pop, continents and alerts, as seen below.
- PS2 Census API (alerts, continent locks, event data)
- agg.ps2.live/population (population)
- Have node & yarn
- Run
yarn install
- Run
yarn start
. It'll generally work. - Want it to really work? Add a
[vars]
to wrangler.toml namedBOT_TOKEN
, or set it as a secret through Wrangler. - Deploy with
yarn wrangler publish
.
Pulls data from our aggregator API, which averages Saerro, Voidwell, Honu, and Fisu populations.
Pulls entire map state from Census, filters down to all 3 warpgates for a given continent, and checks if they're all the same owner. E.g. a TR-locked Indar will have 2201
, 2202
, and 2203
with a TR faction ID.
This may not always keep up with the actual map (like Esamir), so a potential for codegen arises if APIs stablize :)
Pulls world_events with type METAGAME
from Census API; distinctly not joining with the metagame_events table. Instead, we match the known alert types, Conquest, Max, and Air, by their metagame_events type via codegen. Both of these considerations are due to Census API missing Oshur data.
Census will report alerts in the order they both started and ended, we build an array of active events going from the bottom to the top of the list, and remove them when the instance_id
matches another that ended.