Skip to content

viral32111/TwitchBot

Repository files navigation

Twitch Bot

CI CodeQL GitHub tag (with filter) GitHub repository size GitHub release downloads GitHub commit activity

This is my Twitch integration and chat bot, made for Rawreltv.

📥 Usage

The recommended way to run this bot is by using the Docker image. This image is automatically updated every time a commit is pushed.

For example, this command will run the bot in a Docker container using a custom configuration file in the current directory:

docker run \
	--name twitch-bot \
	--mount type=volume,source=twitch-bot,target=/var/lib/twitch-bot \
	--mount type=bind,source=$PWD/config.json,target=/etc/twitch-bot.json \
	ghcr.io/viral32111/twitchbot:latest

⚙️ Configuration

The configuration file is where you should specify Twitch application credentials, channel names, etc.

The default configuration file will be created at the default path, or at the path given as the first command-line argument to the program.

The default path for the configuration file for each operating system is:

  • Windows: %CD%/twitch-bot.json
  • Linux: $PWD/twitch-bot.json

Persistent Data

The bot will create data over time that must be retained across reboots.

The location of this directory can be changed in the configuration file. The default for each operating system is:

  • Windows: %LOCALAPPDATA%/TwitchBot
  • Linux: /var/lib/twitch-bot

Cached Data

The bot will create temporary data over time that is reused across reboots, but can safely be destroyed when closed.

The location of this directory can be changed in the configuration file. The default for each operating system is:

  • Windows: %TEMP%/TwitchBot
  • Linux: /var/cache/twitch-bot

🏗️ Development

When running during development, it is preferred to keep secrets in the .NET user secrets store.

These secrets can be set using the dotnet user-secrets set command. The following secrets are required:

  • AppClientSecret should be your Twitch application's client secret.

⚖️ License

Copyright (C) 2022-2023 viral32111.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses.