A monorepo containing a Telegram Bot and a Svelte web application, both running on Cloudflare Workers and Pages.
This is a monorepo containing:
bot: The main Telegram Bot built with grammYwebapp: A Svelte 5 web application for interacting with the bot
-
Clone the repository with submodules:
git clone --recursive https://github.com/codebam/cf-workers-telegram-bot.git
-
Install dependencies:
npm install
-
Configure the bot: Navigate to the
botdirectory and updatewrangler.tomlwith your desired worker name and bindings. -
Set your Telegram Token: Get a token from @BotFather and add it to your worker:
cd bot npx wrangler secret put SECRET_TELEGRAM_API_TOKEN -
Deploy:
npm run deploy
For more information on deploying grammY bots, see the grammY deployment documentation.
The web app is a SvelteKit project designed to be deployed to Cloudflare Pages.
cd webapp
npm install
npm run build
npx wrangler pages deploy .svelte-kit/cloudflareYou can use the root Makefile to run common tasks across all projects:
make build # Build all projects
make clean # Clean build artifacts-
Install dependencies:
npm install
-
Set up Git hooks: This project uses custom Git hooks for quality control. Run the following script to enable them:
./setup_hooks.sh
Apache-2.0

