/tg-bot-template

This is template project for my telegram bots written in typescript.

Primary LanguageTypeScriptMIT LicenseMIT

Telegram Bot Template

Stack

  • Typescript
  • grammY
  • Prisma

Run

  1. Install dependencies:
npm install
  1. Make .env file from .env.example and provide BOT_TOKEN and ALLOWED_USERNAMES values. ALLOWED_USERNAMES is a comma-separated list of telegram usernames of users who can use bot.
  2. Run postgresql database via provided docker-compose file:
docker compose up
  1. Push database schema:
npx prisma db push
  1. Run bot:
npm run dev

Deploy

Can be deployed to any VPS or cloud service. I recommend using Railway for this purpose.