Your personal Telegram assistant, running serverlessly on Cloudflare Workers.
- 🔔 Smart Reminders - Cron-based, one-time, or conditional triggers
- ⏰ iOS Automation -
/automationendpoint for iOS Shortcuts alarms - 🕌 Prayer Times - Fajr, sunrise, and Jumu'ah reminders
- 📊 Crypto Alerts - BTC Fear & Greed extreme notifications
- Node.js 18+
- Cloudflare account (free tier works)
- Telegram account
git clone https://github.com/stackoverprof/teleworker.git
cd teleworker
npm install- Open Telegram and message @BotFather
- Send
/newbotand follow the prompts - Save the token (looks like
123456789:ABCdefGHI...)
This is needed so your bot knows where to send messages.
- Message @userinfobot on Telegram
- It will reply with your Chat ID (a number like
925512522) - Save this number - you'll use it when creating reminders
npx wrangler d1 create teleworker-dbThis outputs a database ID. Copy it and update wrangler.toml:
[[d1_databases]]
binding = "DB"
database_name = "teleworker-db"
database_id = "YOUR_DATABASE_ID_HERE" # ← Paste herenpm run db:migrate# Your Telegram bot token from Step 2
npx wrangler secret put TELEGRAM_BOT_TOKEN
# A password to protect your API (make up any secure password)
npx wrangler secret put ADMIN_PASSWORDnpm run deployYour bot is now live at https://teleworker.YOUR_SUBDOMAIN.workers.dev 🎉
TELEGRAM_BOT_TOKEN— Set viawrangler secret put, get from @BotFatherADMIN_PASSWORD— Set viawrangler secret put, make up any secure passworddatabase_id— Set inwrangler.toml, get fromwrangler d1 createoutputchatIds— Used when creating reminders, get from @userinfobot
Prayer times are configured for Jakarta. To change, edit src/lib/constants.ts:
export const COORDINATES = {
latitude: -6.2088, // Your latitude
longitude: 106.8456, // Your longitude
};
export const TIMEZONE = "Asia/Jakarta"; // Your timezonecurl -X POST https://your-worker.workers.dev/reminders \
-H "Content-Type: application/json" \
-H "X-Admin-Password: YOUR_PASSWORD" \
-d '{
"name": "Daily Standup",
"message": "🚀 Time for standup meeting!",
"chatIds": "YOUR_CHAT_ID",
"when": "0 2 * * 1-5",
"ring": 0,
"active": 1
}'name(string) — Display name for the remindermessage(string) — Message to send (supports{{variables}})chatIds(string) — Your Telegram chat ID from @userinfobotwhen(string) — Cron expression (UTC) or ISO datering(0 or 1) — 0 = Telegram only, 1 = Include in /automation for iOS alarmsactive(0 or 1) — 0 = Paused, 1 = ActiveapiUrl(string, optional) — Internal route for conditional triggers
0 2 * * 1-5— 2:00 AM UTC, Mon-Fri (9:00 AM WIB)30 7 * * 5— 7:30 AM UTC, Friday (2:30 PM WIB)0 10 * * *— 10:00 AM UTC, daily (5:00 PM WIB)
┌─────────────────────────────────────────────────────────────┐
│ Cloudflare Workers │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌──────────────────────┐ │
│ │ Hono │ │ Scheduler │ │ Microservices │ │
│ │ Router │ │ (Cron) │ ├──────────────────────┤ │
│ │ │ │ │ │ /fng - Fear&Greed │ │
│ │ /reminders │ │ * * * * * │ │ /prayer - Prayer │ │
│ │ /automation │ │ Checks DB │ │ /meetings - Monthly │ │
│ │ │ │ every min │ └──────────────────────┘ │
│ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │
│ └────────────────┼──────────────────────────────────┤
│ ▼ │
│ ┌───────────────┐ │
│ │ D1 SQLite │ │
│ └───────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
┌────────────┴────────────┐
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Telegram │ │ iOS │
│ Bot API │ │ Shortcuts │
└─────────────┘ └─────────────┘
MIT © stackoverprof
Built with ❤️ and ☕ on Cloudflare Workers