A Telegram bot that syncs channel media to Cloudflare R2 storage.
- Node.js >= 22.0.0
- bun >= 1.3.5
- Cloudflare account with R2 enabled
- Telegram Bot Token
-
Clone the repository:
git clone https://github.com/adriangohjw/telegram-sync.git cd telegram-sync -
Install dependencies:
bun install
-
Set up environment variables:
bun run setup:dev
Then edit
.dev.varswith your configuration:TELEGRAM_BOT_TOKEN=your_bot_token_here TELEGRAM_CHANNEL_ID=your_channel_id_here MESSAGE_THREAD_ID=opional_your_group_topic_id TELEGRAM_WEBHOOK_SECRET=secret-key-to-verify-only-telegram-calling-webhook -
Deploy to Cloudflare Workers:
bun run deploy