/Hitori

Serverless Discord bot template using tRPC and Prisma.

Primary LanguageTypeScriptMIT LicenseMIT

Hitori

Serverless Discord bot template using tRPC and Prisma.

Deploy with Vercel

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

  1. Clone the template locally, copy .env.example into .env, and fill it.
  2. Install the dependencies using npm i, or which ever package manager you use.
  3. Run npm run register. This will register the two example commands for your bot (listed in src/pages/api/bot/register.ts)
  4. Now that the commands are registered, you can deploy to Vercel using the button above!
  5. 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.