A Cloudflare Worker that sends Telegram notifications for DAO DAO DAOs.
npm run dev
# OR
wrangler dev --local --persist
-
Make a new bot on Telegram with BotFather and get the token. Instructions here.
-
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}"
-
Copy
wrangler.toml.example
towrangler.toml
. -
Create D1 database for production:
npx wrangler d1 create telegram-notifier
- Update the binding ID in
wrangler.toml
:
[[ d1_databases ]]
binding = "DB"
database_name = "telegram-notifier"
database_id = "<REPLACE DB_ID>"
- 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
npm run deploy
# OR
wrangler deploy