Skip to content

jeonwonje/birthday

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

birthday

A Telegram bot that posts birthday greetings to a chat at midnight, pulling names and messages from a CSV.

Features

  • 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 .env file and one CSV

Built with

Setup

git clone https://github.com/jeonwonje/birthday.git
cd birthday
npm install

Create 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 JOHN

The date column is DD-MM-YYYY. The year is ignored — only day and month are matched.

Usage

npm start

The 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).

License

MIT © Jeon Wonje

About

Birthday message sender in Telegram

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors