A Discord App utilizing Cloudflare Workers that allows for stats to be pulled for Halo games played in a custom games series.
Warning
This is a functional proof of concept.
This Discord bot can pull stats from Halo Waypoint and post accordingly.
- Work with NeatQueue results
/stats <channel where NeatQueue results live> <queue number>
# example: /stats #results 777
- Download and install node.js if you haven't done already
- Clone the repo (assuming you already know how)
- Follow the instructions from
discord/cloudflare-sample-app
Now in a channel you can use /stats
command.
As mentioned, this is presently a proof of concept and more can be done to improve it but as of now:
- User sends slash command to Discord bot
- Discord bot searches the Discord channel for NeatQueue messages and finds the one with the matching queue number
- From the NeatQueue message, pull all the Discord users
- Query Halo Waypoint endpoint to search for gamertags a. Tries with Discord username b. If unsuccessful, tries to Discord display name c. If still unsuccessful, disregard
- Query Halo waypoint for custom games for matched users a. From step 4, it isn't guaranteed and a better solution can be built (this is okay for proof of concept) b. Privacy settings means that some users won't have matches found
- Of the matches that have been found for players, filter to ones involving all players a. do additional filtering to ensure the most recent game has all the same players as every other game found
- Pull stats for each match
- Send back to Discord
- User sends slash command to Discord bot
- Pull stats for match
- Send back to Discord