A bot to interact with Twitch, Discord, and anything else your mind (and my freetime) can imagine.
- !active - toggles whether commands work or not
- !add - adds a command (or edits the existing command) with the specified message
- !rm - removes the specified command
- !reset - reset face cam and mic changes back to default
- !addw <word/phrase> - adds a word/phrase to be tracked
- !rmw <word/phrase> - removes a word/phrase from being tracked
- !incw <word/phrase> number:optional - increments the word/phrase count. Optional number parameter sets the amount to increment by
- !clrw <word/phrase> - resets the word/phrase count back to 0
- !help - displays help command (this shows different commands based on where it is triggered from)
- Any of the commands added with the !add command are accessible in both locations
- !wordcount <word/phrase> - gets the tracked count of a word/phrase
- !lightsoff - turns off the lights in stream room
- !lightson - turns on the lights in stream room
- !lights <color_name/R G B> - sets color of lights in stream room
- color_name must be a valid CSS3 color name
- ex: !lightscol red
- RGB value must be 3 numbers between 0 and 255
- ex: !lightscol 255 0 0
- color_name must be a valid CSS3 color name
- !lightsr - sets color of lights in stream room to random color
- Toggle Webcam - Toggles face cam visibility
- Toggle Mic - Toggles desktop mic active
- Change Cam Overlay Color - Changes face cam color overlay color. Number parameter causes color to change that many times in 1 second (max 1000)
- Toggle Aqua - Toggle Aqua visibility on scenes with her in them
Authentication is done using the Twitch OAuth Authorization Code Flow.
This basic walkthrough explains the process, as well as how to get refreshing tokens obtained for the twitch-chat-client library. Currently tokens are just stored in a JSON file which is read from/written to when obtaining and refreshing access tokens.
For local development the botTokens.json
file is read in using the TWITCH_BOT_TOKENS_FILE_LOCATION
environment variable and the channelTokens.json
file is read in using the TWITCH_CHANNEL_TOKENS_FILE_LOCATION
environment variable. When running from Docker, a directory containing the botTokens.json
and channelTokens.json
files must be mounted as a volume to the /var/bot
directory.
- Failure to connect to Twitch chat and respond to commands means the channel tokens need refreshed manually
https://discord.com/api/oauth2/authorize?client_id=772707347520946197&permissions=0&scope=bot