Birthday notifications for SinusBot
Sends private message or pokes users on join when someone had birthday.
- copy
birthday.js
into yourscripts
folder - restart sinusbot
- fill in admin options in Web GUI
- activate script in Web GUI
- 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
!birthdays
lists all birthdays!birthday
show own birthday!birthday <date>
set own birthday, where<date>
could be24.12.
,dec-24
,12-24
or similar!birtday clear
reset own birthday
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.
- Download
ws-server.js
andnode_modules
into a seperate folder.
git clone https://github.com/subDesTagesMitExtraKaese/sinusbot-birthday-script
cd sinusbot-birthday-script
- Create
secrets.js
and enter your CardDAV server credentials.
module.exports = {
davUrl: 'https://example.com/dav.php',
davUsername: 'username',
davPassword: 'password',
davAddressBook: ''
}
- install node.js
sudo apt update
sudo apt upgrade -y
sudo apt autoremove
sudo apt install nodejs
- test the program with sinusbot running
node ws-server.js
- 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