Hitori
Serverless Discord bot template using tRPC and Prisma.
But, why?
Typical Discord bots are ran in a node.js enviroment and need to be connected to Discords Gateway 24/7, which requires a VPS or paid bot hosting. Hitori, however, runs off of interaction webhooks. Allowing you to create simple, yet efficent Discord bots which are online 24/7, and don't cost anything.
Advantages
- Ability to deploy to Vercel, allowing for automating deployments.
- Bring in technologies like tRPC and Prisma (Unusable in Cloudflare worker solutions).
Caveats
- Inability to listen to most events as there's no Gateway. Meaning events like message create, role delete, etc. are impossible to listen into purely from just this.
How to use
- Clone the template locally, copy
.env.example
into.env
, and fill it. - Install the dependencies using
npm i
, or which ever package manager you use. - Run
npm run register
. This will register the two example commands for your bot (listed insrc/pages/api/bot/register.ts
) - Now that the commands are registered, you can deploy to Vercel using the button above!
- Final step, go to your app on the Discord Developer portal, and set "Interactions Endpoint URL" to
<your vercel URL>/api/bot
bootstrapped with create-t3-app
License
This project is licensed under the MIT license.