This is a template for creating a Telegram Bot using @codebam/cf-workers-telegram-bot on Cloudflare Workers.
-
Install dependencies:
npm install
-
Configure wrangler: Edit
wrangler.tomland change thenameto your bot's name. -
Set your Telegram Token:
npx wrangler secret put SECRET_TELEGRAM_API_TOKEN
-
Develop:
npm run dev
-
Deploy:
npm run deploy
-
Set Webhook:
https://<your-worker>.<your-subdomain>.workers.dev/<SECRET_TELEGRAM_API_TOKEN>/setWebhook
src/index.ts: The main entry point where you define your bot and handlers.test/index.spec.ts: Unit tests for your bot.wrangler.toml: Cloudflare Workers configuration.