advent of code discord intergration
- Ensure you have Go 1.21 or newer installed
- Run
go mod download
- Copy
.env.dist
to.env
and populate it's contentsELF_DISCORD_TOKEN
: Discord token for the bot user to run asELF_DISCORD_APP_ID
: ID of the Discord app the bot belongs toELF_DISCORD_GUILD_ID
: ID of the Discord guild to register commands on. Leave blank if you're looking to run a production instance of the bot. If you're working on the bot, provide the ID of the guild you will be testing inELF_ADVENT_OF_CODE_SESSION
: Advent of Code session cookie for the bot user
- Run
go run . run
If you were using a testing bot, and need to clean up the command registrations, you can use a tool such as command-clearer to remove existing commands.
If you are developing (or if the onboarding process still doesn't exist as of you reading this), it is helpful to manually insert a testing guild into the database. This can be done with the testdata
tool included.
Example:
go run . testdata --channel-id 909857762064871444 --guild-id 514110851016556567 --leaderboard-code 1111111-11111111 --leaderboard-id 0000001