A telegram bot that alerts you whose birthday is coming. The bot is here hbd_alert_bot, deployed on Heroku, now I deployed it on my own RaspberryPi.
- Telegram bot using telegraf, written in TypeScript.
- Database support using MySQL with Typeorm
- Alert periodically, using node-cron, based on GNU crontab.
- Date calculation using day.js.
- Configurable. Set the timezone, alert schedule, mysql configuration and debug proxy freely.
- Tell you whose birthday is already today, or in 3 days, or will be in this week.
-
Clone the repo
git clone https://github.com/Thungghuan/hbd-alert-bot.git
-
Install dependencies, and modify the config file
cd hbd-alert-bot npm i cp config/index.example.ts config/index.ts vim config/index.ts
-
Remember to set your own token in the configure file
export default { BOT_TOKEN: '<bot token here>' }
-
BTW, notice that your schedule should be set refer to UTC time.
-
Run the bot
npm run start
-
Using docker-compose
docker-compose up
-
Or you can build the image and run
- Add validation when add birthday data.
- Make the alert message more detailed, maybe some words like tomorrow, Next Monday etc.
- Make birthday alert more configurable.
- Make a tool to format the output message.
Have you ever forget someone's birthday? This bot is created to alert you so you won't realize someone's birthday was just pasted, and regretfully tell him or her happy birthday for next year in advanceš¤Ŗ.
I have got a duty to send a hbd message in a wechat group these days, but I usually forget it, so I make this bot, and I wish this bot would help me remember it. Actually making a bot is so fun:)
Wish you have fun making your own bot too.