Skip to content

An IRC bot written in python and made for my Twitch channel Twitch.tv/Ridgure

License

Notifications You must be signed in to change notification settings

Ridgure/AutoHostBot

Repository files navigation

FVCproductions


Markdownify
Auto Host Bot

An IRC bot written in python and made for my Twitch channel Twitch.tv/Ridgure.

Key FeaturesGetting startedAcknowledgementsConnect

Features:

Auto hosting:

Commands for everyone:
General:
Host function that will host the the person on top of your host list

Automated functions:

Done by the bot automatically:
Filter stream titles with regular expressions
Filter games so only games that you like are hosted
Opens stream in Streamlink if you install it
Hosts a new stream as soon as the current stream switches to a game you don't like
Hosts a new stream as soon as the current stream has gone offline
Hosts a new stream as soon as the current title switches to a title you don't like
Sends a message to a discord channel if a new channel is hosted
Socials: Links to socials:
!social Shows all Ridgure's social media accounts
!instagram link to Instagram
!facebook link to Facebook
!twitter link to Twitter
!discord link to Discord
!ctt Generates a custom Click to Tweet link when sent in the twitch chat

Getting started

Clone

Clone this repository to your local machine using git clone https://github.com/Ridgure/AutoHostBot.git

Setup

In order to be able to run the bot add a file AutoHostConfig.py in the same folder as the bot and go through the steps below: AutoHostConfig.py should look something like this:

Host = "irc.twitch.tv"                                                 # The Twitch IRC server
Port = 6667                                                            # Always use port 6667!
Nickname = "<Nickname>"                                                # The username of your bot
Token = "<Token>"                                                      # Your Twitch subscriber token (needs to have the editor scope)
Channel = "#<Channel>"                                                 # The channel you want to join
ClientID = "<Client ID>"                                               # The client ID of your bot
StreamLinkLocation = "C:\Program/Files\Streamlink\\bin\streamlink.exe" # The location of your streamlink install
VLCLocation = "C:\Program/Files\VLC\\vlc.exe"                          # The location of your VLC install
webhook_url = "https://discord.com/api/webhooks/123456"                # The url too your discord webhook
  • Install python 2.7
  • 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 a Client_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 your client 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
  • If you want to post to a Discord channel open its settings in Discord and enable webhooks
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+user:read:subscriptions
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

Running the bot

Run bot.py by going to its location and running this command:

python AutoHostBot.py

Acknowledgements:

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

Connect:

Twitch

See the bot in action when I am not live on Twitch over at Twitch.tv/Ridgure

Social media

Please follow me on: Facebook, Twitter and Instagram

About

An IRC bot written in python and made for my Twitch channel Twitch.tv/Ridgure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages