A serverless Discord bot designed for Cloudflare Workers.
Average CPU Time (roughly) w/o database:
- Median: 3.5 milliseconds
- 50th percentile: 3.5 milliseconds
- 75th percentile: 4.4 milliseconds
- 99th percentile: 5.1 milliseconds
- 99.9th percentile: 5.2 milliseconds
Features:
- Basic i18n implementation
- Built in database via Prisma
- Chat input support
- Context menu support
- Easy deployment of commands
- Minimal dependencies
- Object-oriented design
- Organized command structure
- Written in TypeScript
Secrets: DATABASE_URL, DISCORD_APPLICATION_ID, DISCORD_TOKEN, DISCORD_PUBLIC_KEY
- Run "npm i"
- Install Wrangler globally with "npm i wrangler -g"
- Set environment variables locally (see sample.env file)
- Run "npm run generate"
- Create a Cloudflare Worker and set its name in the wrangler.toml file
- Create an application at https://discord.dev
- Create a Prisma Proxy at https://cloud.prisma.io
- Set environment variables/secrets in both the Worker dashboard and the wrangler.toml file
- Run "npm run dev" for local testing (use ngrok or similar to route localhost)
- Run "npm run publish" to deploy to Cloudflare Workers
- Set your Worker's link in the interaction endpoint URL of your Discord application