A bot written in python and made for my Twitch channel Twitch.tv/Ridgure.
Key Features • Getting started • Acknowledgements • Connect
Automated functions:
Done by the bot automatically: |
---|
Gets the tags of a category on Twitch |
Blacklist certain tags |
Clone
Clone this repository to your local machine using
git clone https://github.com/Ridgure/TagsBot.git
Setup
In order to be able to run the bot add a file config.py
in the same folder as the bot and go through the steps below:
config.py
should look something like this:
FollowerToken = "<Token>" # Token generated by twitchapps.com/tmi without the oauth: part
ClientID = "<ClientID>" # Your client ID
ClientSecret = "<Client Secret>" # The client secret of your bot
Specify a blacklist in blacklist.py
tags should be in quotation marks and separated by a comma.
tagsBlacklist = ['rerun', 'test']
- Create a Twitch account with the name of your bot
- Register your application on the Twitch developer site
- Set the Name to the name of the account you just created
- Set the redirect uri to
http://localhost
- Set the application directory to Chat Bot
- Agree to the terms and conditions
- Get a
Client_ID
and aClient_Secret
- Generate your token for accessing follower data and chat
- Go to Get token here and click connect with twitch
- Click Authorize
- Your token should look something like this:
oauth:a1b2c3d4e5f6g7h8i9j1k2l3m5n6o7
- Generate your token for accessing subscriber data
- Go to the link underneath
- Remember to swap out
<clientID>
with yourclient id!
- Click Authenticate
- It will look like you got a blank page but your url should look like the second url
- Your access token is the gibberish where it says Token in the url
https://id.twitch.tv/oauth2/authorize?client_id=<clientID>&redirect_uri=http://localhost&response_type=token&scope=channel_subscriptions+user_read+channel_check_subscription+chat_login
http://localhost/#access_token=<Token>&scope=channel_subscriptions+user_read+channel_check_subscription+chat_login&token_type=bearer
Prerequisites
You will need to install these things to run the bot
- Python 3.10
- Libraries:
Running the bot
Run bot.py by going to its location and running this command:
py -3.10 tagsBot.py
This whole project started off with this Instructables article
Other interesting projects to check out:
PythonBot by ZERG3R on Twitch as ZERG3R
Ponderier by DillonEA on Twitch as DillonEA
Xekeism by XekeDeath on Twitch as XekeDeath
Twitch
See the bot in action when I am live on Twitch over at Twitch.tv/Ridgure
Social media