Skip to content

Cloudflare Worker to power the DAO DAO Telegram Notifier bot.

Notifications You must be signed in to change notification settings

DA0-DA0/telegram-notifier-cf-worker

Repository files navigation

telegram-notifier-cf-worker

A Cloudflare Worker that sends Telegram notifications for DAO DAO DAOs.

Development

Run locally

npm run dev
# OR
wrangler dev --local --persist

Configuration

  1. Make a new bot on Telegram with BotFather and get the token. Instructions here.

  2. Set your new bot's webhook to wherever this worker is deployed. For example:

curl -v "https://api.telegram.org/bot{BOT_TOKEN}/setWebhook?url=https://telegram-notifier.dao-dao.workers.dev/telegram&secret_token={WEBHOOK_SECRET}"
  1. Copy wrangler.toml.example to wrangler.toml.

  2. Create D1 database for production:

npx wrangler d1 create telegram-notifier
  1. Update the binding ID in wrangler.toml:
[[ d1_databases ]]
binding = "DB"
database_name = "telegram-notifier"
database_id = "<REPLACE DB_ID>"
  1. Configure secrets:
echo <VALUE> | npx wrangler secret put BOT_TOKEN
echo <VALUE> | npx wrangler secret put WEBHOOK_SECRET
echo <VALUE> | npx wrangler secret put NOTIFY_API_KEY

Deploy

npm run deploy
# OR
wrangler deploy

About

Cloudflare Worker to power the DAO DAO Telegram Notifier bot.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published