No description
Find a file
2023-07-10 20:46:12 +02:00
cmd/birthdaybot Adds logger config 2023-07-10 14:55:47 +02:00
model Adds templates to birthday message 2023-07-10 20:46:12 +02:00
notification Adds templates to birthday message 2023-07-10 20:46:12 +02:00
parser Add a test for the CSV parser and check errors on the read config 2023-06-30 09:51:34 +02:00
server Adds templates to birthday message 2023-07-10 20:46:12 +02:00
.envrc Initial commit 2023-06-29 18:55:13 +02:00
.gitignore Adds initial implementation of the Telegram bot 2023-07-04 12:29:25 +02:00
.gitlab-ci.yml Adds go mock and generate make target and CI check 2023-07-10 12:29:25 +02:00
birthdays.csv Create a sample birthday.csv file 2023-06-30 11:38:03 +02:00
example-config.yml Adds templates to birthday message 2023-07-10 20:46:12 +02:00
go.mod Adds go mock and generate make target and CI check 2023-07-10 12:29:25 +02:00
go.sum Adds go mock and generate make target and CI check 2023-07-10 12:29:25 +02:00
Makefile Adds go mock and generate make target and CI check 2023-07-10 12:29:25 +02:00
README.md Adds templates to birthday message 2023-07-10 20:46:12 +02:00
sample.tmpl Adds templates to birthday message 2023-07-10 20:46:12 +02:00
shell.nix Adds go mock and generate make target and CI check 2023-07-10 12:29:25 +02:00

pipeline status

Birthday bot

A simple bot that notifies of birthdays, posting the contact information of the subject so you can reach them easily.

Configuration

There is an example configuration file that can be used as a base to create your own configuration, and there is a birthdays example CSV file to load the data.

Template file

The template can be configured using the birthday_template config parameter to point to the template file. The template uses the Go Template Format, and has the following properties available:

  • .Name: the name of the person whose birthday we're notifying.
  • .Email: the email of the person.
  • .Phone: the phone of the person, as a string.
  • .YearOfBirth: the year that the person was born, as number.
  • .MonthOfBirth: the month that the person was born, as number.
  • .DayOfBirth: the day that the person was born, as number.

Run the bot

To get help for the bot command, run:

$ ./birthdaybot -help
Usage of ./birthdaybot:
  -config string
        path to the configuration file (default "birthdaybot.yml")

To run the server with the development defaults, run:

$ make run

Roadmap

  • Create the bot scaffold
  • Define how to read the birthdays info
  • Add a logger instance to the config
  • Add config validation on server creation
  • Add options to the server
  • Pass logger to the server through an option
  • Configure logger through config (levels and such)
  • Reduce logger verbosity (through levels)
  • Add pictures to birthday notifications
  • Create a configurable template to fill with each notification
  • Create different message systems to use with the bot
    • Telegram
    • Email
    • Mattermost
  • Enjoy!