A Twitch bot that runs a simple word-guessing game. It provides features that allow chatters to guess words and earn points and tokens.
The game is played in rounds, where each round consists of a supplied wordlist. When every word in the wordlist has been guessed, or upon manually ending the round, players are awarded with tokens which can be used to call the bot's built-in redeem system.
The redeem system is, currently, very simple in design: it verifies the user has enough tokens, then writes a message in chat in the format of "REDEEM redeem_name". Then the tokens are subtracted from the user who called the command.
This is not a general-purpose bot. The sole purpose of GuessingGame_TTV is, as the name implies, to run the guessing game. There are no plans to expand the features to allow for moderation or more advanced configurations, unrelated to the guessing game.
Examples (Linux):
curl
wget
Installing GGTV from source is almost the same on all major platforms (including BSD). With the inclusion of automated builds, it is no longer recommended to install from source. This option should be taken only if you want to beta test or contribute.
GuessingGame_TTV uses features from Python 3.10, versions below this will not run.
Install Python and Git from your package manager.
These steps are the same on all platforms, though the commands may vary slightly.
$ git clone https://github.com/bastisawesome/guessinggame_ttv.git
Linux/MacOS (pip3):
$ pip3 install --user pipenv
Windows:
> pip install --user pipenv
pip install
, there may be updates that break the bot. If
this happens, you will have to re-clone the repo.$ pipenv sync --dev
GuessingGame_TTV can be run in one of two ways:
$ cd ~/guessinggame_ttv
$ pipenv shell
$ python -m guessinggame_ttv
$ pipenv run guessinggame_ttv/src/guessinggame_ttv/main.py
You can choose to build your own executable to use instead of running directly from source in one of two ways:
From Pipenv Shell:
$ pipenv shell
$ python tools/build_release.py
dist/
to a new location and extract it. See
above for using the generated executable.From external shell
$ pipenv run build-release
dist/
to a new location and extract it. See
above for using the generated executable.An example configuration file is provided in the templates/
directory of the
source code. Copy this file into config/
and fill in the values, following
the comments in the template.
Twitch OAuth2 requires a few extra steps before you can use the bot. Twitch requires you to create a separate account for the bot and connect that account to your stream account using the developer tools.
http://localhost
). The category should be "chat bot".Currently, the only supported method of running the bot is through the terminal.
There are plans in the future to include templates for Linux that allow you to
run the bot through Systemd
and Supervisorctl
. Windows and MacOS users may
need to wait and see if we are able to support similar methods for their
platforms.
The general usage of GuessingGame_TTV is the same on all major platforms, but we describe Windows and Linux/MacOS separately primarily due to the executable being named differently.
Linux/MacOS:
$ ./guessinggame_ttv
For more usage instructions, run:
$ ./guessinggame_ttv --help
Windows:
> .\guessinggame_ttv.exe
For more usage instructions, run:
> .\guessinggame_ttv.exe --help
WARNING:
Make sure the bot is not running before you enter interactive mode. Any changes made while the bot is running may be overwritten later.
The CLI, accessed by running the bot in interactive mode (--interactive
argument), is the primary method of configuring the bot. Future plans do
include a more user-friendly web interface.
The CLI allows you to configure the wordlist and redeems using simple menus.
The wordlist file format is one of the more complex features of GuessingGame_TTV. The format is based on INI configuration files, but without any values. In fact, you can fill in values for each key and they will simply be ignored.
Each section header is a category to be added, while each option key is a particular word to add under that category. The entire file is read into the database. The file will not be deleted after it has been read.
IMPORTANT: This will wipe the existing wordlist and the option should only be used when there is no currently-running round, as it will not end the round.
An example wordlist file is included in the templates/
directory.
GuessingGame_TTV has support for Restream messages. Viewers on YouTube and other platforms can participate just the same as Twitch users.
Users on platforms that allow spaces in usernames, such as YouTube, are stored with underscores in place of spaces. To view their scores or tokens the spaces must be replaced with underscores. Their usernames in messages will also reflect this.