This is a serverless Discord bot designed to get your Discord account the "Active Developer" badge while hopefully learning a little bit about serverless technology.
Based on https://github.com/Attituding/serverless-discord-bot.
- Install Git and Node on to your machine
- Have a Cloudflare account
- Have a Discord account
- Use "git clone" to clone this repository to your local machine
- Navigate to the project's folder on your machine
- Create a .env file at the root of this project filled with the fields from the sample.env file
- Create an application with a memorable name at https://discord.dev and note the application Id and public key
- Navigate to the Bot tab to create a bot user and press reset token to generate a bot token (keep this very secret)
- Fill the .env file with the above information you just gathered
- Run "npm i" in a terminal in that folder
- Run "npm run deploy" and hope you see "Registered global commands" pop up
- Install Wrangler globally with "npm i wrangler -g"
- Login to Cloudflare through Wrangler with "npx wrangler login" and following the oauth flow
- Replace "name" and "DISCORD_PUBLIC_KEY" in the wrangler.toml file with a cool name of you choice and your application's public key
- Run "npm run publish" to create and deploy a Cloudflare Worker
- Navigate to your Cloudflare dashboard and click ont eh Workers tab
- Click on the Worker that has the cool name you chose
- Click on the deployments tab and note the URL under "Current deployment"
- Set this URL in the interaction endpoint URL section in your application's General tab
- Go to the OAuth2 tab and click "URL Generator"
- Click on applications.commands and then copy the link generated
- Paste the link in to your browser and invite your bot to a server you manage (an empty test server is recommended)
- Type "/" in chat, select the ping command, and run it
- Wait about 24 hours (or less) and check https://discord.com/developers/active-developer to claim your badge