Xernito / twitch_count_bot

A simple Twitch bot that counts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Twitch Count Bot

Follow me: [YouTube] | [Twitch] | [Discord] | [Twitter Follow]

Simple Twitch bot template with three commands:

  • !count: shows the count from data.json
  • !add NUMBER: adds NUMBER to count in data.json
  • !sub NUMBER: subtracts NUMBER from count in data.json

Setup Video

Youtube Video Link

Setup and Run

Requires Python 3.7.3.

Install necessary packages (locally):

python3 -m pip install -r requirements.txt

Copy .env.sample to .env

cp .env.sample .env

Open .env and insert the following fields:

 Field  Explanation
 TMI_TOKEN  OAuth Token with oauth: as a prefix
CLIENT_ID  Client ID obtained from Twitch's Developer site
 BOT_NICK  Twitch name of the Bot
BOT_PREFIX  Prefix for commands the bot should listen to (set to ! per default)
 CHANNEL The name of the your Twitch channel you want the bot to run at

Start Bot:

python3 bot.py

Add the Bot to Autostart/systemd (Raspberry Pi OS)

Install necessary packages (globally):

sudo -H python3 -m pip install -r requirements.txt

Open the unit file twitch_count_bot.service and check if the path to bot.py under [Serivce] ExecStart is correct.

Copy systemd unit file to unit file directory:

sudo cp twitch_count_bot.service /lib/systemd/system

Reload all units:

sudo systemctl daemon-release

Enable the Twitch Count Bot Unit:

sudo systemctl enable twitch_count_bot.service

Start the bot:

sudo systemctl start twitch_count_bot.service

Check if the bot is running with:

sudo systemctl status twitch_count_bot.service

Check if the output of the bot if an error occurs:

sudo systemctl enable twitch_count_bot.service

Credits

K0nze Logo Created by Konstantin (Konze) Lübeck

About

A simple Twitch bot that counts

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%