| .env_template | ||
| .gitignore | ||
| bot.py | ||
| get_id.py | ||
| README.md | ||
| requirements.txt | ||
thearstbot - thearst3rd's Twitch Bot
I thought it'd be fun to make a twitch bot, so here it is! Over the years I've added goofy little things to it, including many ideas from viewer requests. It should usually be active when I'm streaming on my twitch channel.
Run instructions
Install python3, create a virtual environment (optional but recommended), then install the requirements:
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
Make a copy of .env_template and name it .env. Follow the instructions on TwitchIO's documentation for "Creating a Twitch Application". The resulting CLIENT_ID and CLIENT_SECRET values should go in .env.
Get the IDs of your bot account and your main channel account. You can use get_id.py to do that, just put in the names of the channels to search for in CHANNELS_TO_GET_IDS. Those IDs also go in .env in their respective places. Also, put the username of your main channel in CHANNEL in .env.
If you want to use the !weather command, create an account on https://www.weatherapi.com/ and put your token in WEATHERAPI_KEY in .env.
Then, run the bot:
python3 bot.py
Once the bot is running, you will need to do a one-time token generation step. (Steps adjusted from TwitchIO docs on A Minimal bot):
- In a browser logged into your bot account, visit the link and accept:
- In a browser logged into your main channel's account, visit the link and accept:
Now the bot should be all set! If you stop the bot and run it again, you don't need to do the token setup again. Please lmk if you run into issues :)