Discord Bot with twitch emote support.
- Set up environment variables for discord API token, Riot games API, and ChampionGG API in a .env file at root directory with
export DISCORD_API_TOKEN=*TOKEN HERE*
.. useRIOT_API
andCHAMP_API
for the other two keys. - Install required dependencies by running the dependencies.sh file
- To reboot pi daily, edit by running
sudo crontab -e
and using this cron format to reboot at a specific time:0 4 * * * /sbin/shutdown -r now
- To start a script at boot, edit the
autostart
file in~/.config/lxsession/.../autostart
add a new line with@bash /path/to/script.sh
- For Raspbian lite, open to
sudo vim /etc/rc.local
and add:su pi -c 'bash /pathto/script.sh &'
to make it run at startup (&
makes it so the process runs in the background) - Set up postgres from
https://opensource.com/article/17/10/set-postgres-database-your-raspberry-pi
- autostart postgresql at boot
sudo update-rc.d postgresql enable
- To connect external HDD to a directory, use:
/dev/sda1 /path/to/dir ntfs-3g async,uid=*USER HERE*,gid=*USER HERE*,umask=000,defaults,sync,auto,nosuid,rw,nouser 0 0
- Need to install
ntfs-3g
for this to work - Check if you can mount the HDD. Check mount location with
sudo fdisk -l
and then check if you can mount it withsudo mount /dev/sda1 /path/to/mount/dir
if it works, then do the next step - Dont need all that ^ just need to set up fstab with
/dev/sda1 /path/to/mount/dir ntfs-3g rw,default 0 0
- Need to install
- mount external HDD from Readyshare via fstab:
sudo vim /etc/fstab
and add//##.##.##.##/USB_Storage/ /path/to/directory cifs user,guest,uid=pi,gid=pi,rw,iocharset=utf8 0 0
to the end of the file to connect the HDD to a directory. - To give proper permissions so that Transmission can run without encountering errors, stop the service
sudo service transmission-daemon stop
and then follow:- Open
sudo vim /etc/init.d/transmission-daemon
and change theUSER
topi
- Change permissions to these files:
sudo chown -R pi:pi /etc/transmission-daemon sudo chown -R pi:pi /etc/init.d/transmission-daemon sudo chown -R pi:pi /var/lib/transmission-daemon
- Change
USER
topi
fromsudo vim /etc/systemd/system/multi-user.target.wants/transmission-daemon.service
- Reload service
sudo systemctl daemon-reload
- Copy Transmission files to home directory and give it proper permissions:
sudo mkdir -p /home/pi/.config/transmission-daemon/ sudo ln -s /etc/transmission-daemon/settings.json /home/pi/.config/transmission-daemon/ sudo chown -R pi:pi /home/pi/.config/transmission-daemon/
- start service
sudo service transmission-daemon start
- Open
- Ignore localhost : https://docs.pi-hole.net/ftldns/configfile/
:(.*)\!.*@.*\.tmi\.twitch\.tv PRIVMSG #(.*?) :(.*)