Telegram bot boilerplate built with Bun, TypeScript, and grammY.
- Bun 1+
Rename .env-sample to .env and fill in your values:
BOT_TOKEN="<YOUR_BOT_API_TOKEN>"
USERNAME="<YOUR_BOT_USERNAME>"
WEBHOOK_URL="<THE_URL_OF_YOUR_WEBHOOK>"
PORT="3000"
NODE_ENV="development"
Install dependencies and start the dev server:
bun install
bun dev
| Script | Description |
|---|---|
bun dev |
Run in development mode with file watching |
bun run build |
Bundle to dist/ |
bun start |
Run the bundled bot in production mode |
bun run typecheck |
Run TypeScript type checking |
bun run lint |
Run ESLint |
bun run format |
Format source files with Prettier |
src/
βββ index.ts # Entry point β bot setup, polling/webhook
βββ commands/
β βββ about/ # /about command
βββ text/
βββ greeting/ # Text message handler
Pull requests are welcome.