Basic twitch bot. Code is pulled from the example on the TwtichAPI and PyTwitch websites and slightly modified. Code is modified to obfuscate Bot credentials.
- TwitchAPI (pip install twitchAPI)
- configparser (pip install configparser)
- Clone the repo to you computer
- Ensure you have Python installed (https://www.python.org/downloads/)
- Install the libraries above with pip
- Create a bot account with twitch with 2FA enabled (make the username what you want your bot to be called)
- Ensure you have an Application created over at https://dev.twitch.tv/console
- Redirect URL must be http://localhost:17563
- Put the Client ID and Client Secret in the config file once its created (unquoted, the bot converts it to a string)
- Put the channel name in the config file (unquoted, the bot converts it to a string)
- Once you have all of that done, you should have a config file in the root folder with the credentials filled out and channel name
- Login to the bot account on twitch
- Open a terminal in the folder with the bot_main.py script and run it with .\bot_main.py
- It should open a window and you can authorize the bot on the logged in account
- Once authorized it will then join the chat room and listen for events and commands
- Listens to chat and logs it to the bots console with command !cl
- Comes with an example !reply chat command
- Obfuscated credentials and automatic token refresh on starting the bot
- Plenty of room for modification and more features
- !bingoStatus to check game status
- !bingoStart to start bingo game
- !bingoChoose NUMBER to choose number
- !bingoStop to stope game
- !bingoWinner to choose winner
- Should be ready to go out of box.
-
- run bingo start
-
- then choose numbers with bingo choose
-
- run bingo stop
-
- then finally run bingo winner.