Skip to content

subDesTagesMitExtraKaese/sinusbot-birthday-script

Repository files navigation

sinusbot-birthday-script

Birthday notifications for SinusBot

Sends private message or pokes users on join when someone had birthday.

Install

  1. copy birthday.js into your scripts folder
  2. restart sinusbot
  3. fill in admin options in Web GUI
  4. activate script in Web GUI

Admin options

  • The message that should be displayed. (%n = nickname, %b = list of birthdays)
Hallo %n! Diese Personen haben Geburtstag:
%b
Um deinen eigenen angekündigt zu haben, schreibe einfach z. B.:
!birthday 24.12.
  • select 'Private chat' or 'Poke'
  • send the notification upto N days after birthday
  • set a birthday server group by id or name

Commands

  • !birthdays lists all birthdays
  • !birthday show own birthday
  • !birthday <date> set own birthday, where <date> could be 24.12., dec-24, 12-24or similar
  • !birtday clear reset own birthday

Setup CardDAV client

Sinusbot doesn't allow direct communication via DAV, so this client runs seperately. They communicate via ws://127.0.0.1:23845, so the DAV program has to run on the same host as Sinusbot.

  1. Download ws-server.js and node_modules into a seperate folder.
git clone https://github.com/subDesTagesMitExtraKaese/sinusbot-birthday-script
cd sinusbot-birthday-script
  1. Create secrets.js and enter your CardDAV server credentials.
module.exports = {
  davUrl:         'https://example.com/dav.php',
  davUsername:    'username',
  davPassword:    'password',
  davAddressBook: ''
}
  1. install node.js
sudo apt update
sudo apt upgrade -y
sudo apt autoremove
sudo apt install nodejs
  1. test the program with sinusbot running
node ws-server.js
  1. make it run on boot: create /lib/systemd/system/sinusbot-birthday-sync.service
[Unit]
Description=Sinusbot birthday cardDAV sync service
Wants=network-online.target
After=syslog.target network.target network-online.target

[Service]
User=sinusbot
ExecStart=/usr/bin/node /path/to/your/ws-server.js
WorkingDirectory=/path/to/your
Type=simple

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable sinusbot-birthday-sync.service
sudo systemctl start sinusbot-birthday-sync.service

About

Birthday notifications for SinusBot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published