You will need to add an OAuth2 redirect URI to your Discord appliaction in the format of https://your-worker.workers.dev/api/auth/authorize. After that, create a .dev.vars file based on .dev.vars.example with all of your secrets filled in, then run:
# development
$ bun run dev
# bench the size of your deployment
$ bun run dry-deploy
# deploy
$ bun run deploy
Silly service
A cron schedule that runs every day at 2:00 AM UTC which gives the bot a randomized avatar, banner and even FPTE color theme. This is disabled by default.
To enable this, you have to create a Discord Bot user for your application. After creating it, save its token in .dev.vars:
# optional and only used for Silly cron schedule
CLIENT_TOKEN="Bot [your token here]"
Then run:
# install with optional dependencies
$ bun install
# publish secrets
$ bunx wrangler secret bulk .dev.vars
Testing
There are some basic tests in the test folder, but if you're feeling brave enough, feel free to write some actual unit tests!
License
MIT
[^1]: setup guide is here
[^2]: creating a Discord bot (seperate from an application) is only required if you need a bot token (for exaple for the silly service)