Skip to content

This Telegram bot will send you notifications about your friends' birthdays

Notifications You must be signed in to change notification settings

MrGauz/BirthdaysBot

Repository files navigation


BirthdaysBot

This Telegram bot is a brilliant little example of how a simple iCal parser will make you a better human being. Seriously.

Ok, if we're being serious serious, this bot will actually just send you notifications about your friends' birthdays. Which, in part, will make you a better human being if you decide to act on the message.

Why, even?

Primarily because Google Calendar users can't enable notifications for birthdays calendar. Don't ask yourself why a multi-trillion dollar corporation doesn't give this option to its users. You will not know.

How do I use the bot?

Quite easily. Just send an .ics file to the bot.

Keep in mind: the bot itself provides no interface for interacting with birthday information. If you want to change something, be it someone's name, date of birth (who knows, you do you), or add new birthdays, do the changes in the calendar.

First, replace or add info to the calendar. Then export the calendar. Then reupload the .ics file to the bot.

How do I get the ICS file?

You have a couple of options.

  1. Go to Google Calendar's website and log in.
    • Use the desktop version; the mobile app does not support exporting calendars
  2. Open Settings in the top right corner.
  3. Navigate to the "Import & export" tab and click "Export".
  4. You will get a ZIP archive containing separate .ics files for each of the calendars

macOS native Calendar.App

  1. In the Calendar List, pick a calendar you'd like to export.
  2. File --> Export --> Export...
  3. Export. Done.

Wanna host this bot yourself?

BirthdaysBot imports birthdays into a local SQLite file to schedule notifications.

This data will be kept private and secure, never given to third parties or used for any purposes other than notifying you.

However, if you don't feel comfortable entrusting me with this data — host your own bot.

  1. Clone this repository:
    • git clone https://github.com/MrGauz/BirthdaysBot.git
  2. Create a Telegram bot using @BotFather:
    • After the bot is registered, you'll get an API token; use it in the next step.
    • Keep API token a secret!
  3. Make a copy of .env.example and name it .env:
    • Put the API token into the .env.
  4. Install .NET Runtime 5.0.
  5. Build the project; compiled code can be found in bin/Release/net5.0/:
    • dotnet build -c Release.
    • Make sure .env was copied to the folder with compiled code.
  6. Run your bot:
    • dotnet bin/Release/net5.0/BirthdaysBot.dll
  7. ???
  8. PROFIT!

(Possible) future plans

Let's be frank: it's an open-source Telegram bot. Most likely, it'll be serving its purpose for as long as it should, but it won't become a multi-million dollar startup.

However, a couple of ideas might be implemented in the future. Or not. See the paragraph above.

  • Support adding birthdays from the contacts list.
  • Instructions on how to export calendars from more platforms.
  • Configure notifications time.
  • Let users add/remove birthdays right from the Telegram bot UI without importing .ics.
  • Turn this into a bank.

MIT License

TL;DR: do whatever you want; I'm not liable for anything.

MIT License

Copyright (c) 2022 Kirill Gringauz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this Software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS, " WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

This README.md has been written together with Daniel Bilyk. Go say hello to him if you want your project's story to be told in a way that wants to be read.

About

This Telegram bot will send you notifications about your friends' birthdays

Topics

Resources

Stars

Watchers

Forks