A Telegram bot that posts birthday greetings to a chat at midnight, pulling names and messages from a CSV.
- Runs a daily cron job at 00:00:10 Asia/Singapore time
- Matches today's day and month against entries in
data.csv - Sends a custom message and Telegram handle for each matching person
- Configured via a single
.envfile and one CSV
- Node.js (ES modules)
node-telegram-bot-apicronfor schedulingcsv-parsefor reading the data file
git clone https://github.com/jeonwonje/birthday.git
cd birthday
npm installCreate a Telegram bot by messaging @BotFather and copy the token it gives you. Then find the chat ID for the group you want the bot to post in — easiest way is to add the bot, send a message, and call https://api.telegram.org/bot<TOKEN>/getUpdates.
Copy .env.example to .env and fill in:
BOT_TOKEN=your_bot_token
CHAT_ID_PROD=your_chat_id
Copy .csv.example to data.csv and add one row per person:
name,telehandle,date,message
John Doe,@JohnDoe,19-12-1999,HAPPY BIRTHDAY JOHNThe date column is DD-MM-YYYY. The year is ignored — only day and month are matched.
npm startThe process needs to stay running for the cron job to fire, so deploy it on a small VPS or anywhere you can keep a Node process alive (e.g. pm2, systemd, a free-tier cloud instance).
MIT © Jeon Wonje