Do you have that one friend that really likes Hollow Knight. Are they waiting for Silksong to come out? Heckle them with this Discord bot.
This bot plays the most recent video from the Daily Silksong News Youtube Channel whenever a specific user enters voice chat once a day.
You should have python3
installed, instruction can be found here.
Install discord.py
with additional voice extensions, instructions can be found here.
Note that linux systems will need additional packages installed:
- libffi
- libnacl
- python3-dev
Debian example:
apt install libffi-dev libnacl-dev python3-dev
pip3 install -r requirements.txt
This script expects to have a file named .env
holding 2 vars
The TOKEN
var is the discord bot token. This can be obtained through the Discord Developer Portal, instructions found here.
The YT_API_KEY
var is the youtube API key. This can be obtained through GCP, instruction found here.
Example .env
file:
TOKEN=thisisnotarealtoken
YT_API_KEY=thisisnotarealkey
python3 main.py
Change the member name check on line 38 (Note this is their account name, not their server nickname):
# check if ben
if member.name != "parasol24":
return
I recommend using tmux
to just have the Python bot run in the background constantly to serve requests.
Starting up the tmux
tmux new -s silkbot
Detaching from the session:
Press Crtl+b
then press d
Reconnect to session:
tmux attach -t silkbot