Skip to content

This repo holds all the various things a streamer would want from integration with Twitch and Bttv

License

Notifications You must be signed in to change notification settings

Treee/twitch-bot

Repository files navigation

twitch-bot

How To Use

  1. Open a console in a folder/directory of your choice.
  2. git clone https://github.com/Treee/twitch-bot - Clone the repository Requires Git
  3. npm install - Install dependencies. Requires NodeJS
  4. npm run build - Build the code.
  5. npm start - Run the server to start listening to twitch chat.

Additional Information

This server assumes you can provide a file in the ./src directory called secrets.ts this includes api specific information. Take the example below and fill in your own values.

export const SECRETS = {
    botClientId: 'abcdefghijklmnopqrstuvwxyz',
    botClientSecret: 'zyxwvutsrqpomnlkjighfedcba',
    serverPort: 8080,
    steam: {
        apiKey: 'FD1D5F3BA10E8097F1E321075964F69C',
        userId: '61087776597019628'
    },
    irc: {
        user: 'twitchUserName that will log into irc',
        userOAuthPassword: '7wcqd83kk8v6w75i7q3np838ys2h42',
        channelsToListenTo: ['name of the channel to listen to', 'add another if you want']
    }
};

Client Id and Client Secret

Login and Create/Register Your App with twitch. Use http://localhost as the default redirect url and choose Chatbot as the Category. The clientId is visible and click to see the secret. Keep the client secret private and do not share it with anyone.

Server Port

This can be any open port.

IRC

This is this user that will be authenticating to the Twitch IRC chat. Navigate to OAuth Token Generator. Make sure to authenticate with the same user the bot is using.

Steam API Key and User Id (Optional)

API Key

This segment is optional and only needed if you want Steam integration with the chatbot. Create Your API Key.

UserId

Log in with your account to the web version of Steam. Navigate to your profile. Steam Profile

Find the url and copy the name https://steamcommunity.com/id/{UserName}/. Use SteamID Finder to locate your Steam Id from your {UserName}

Deploy to Server

If you want to deploy the server in the cloud you will need to accomodate for SSL since browsers no longer allow unsecure websockets to be created client-side. I provide a rough draft of how I did it but my environment is custom so it most likely won't apply.

Screens

Create the screen and name it. screen -S foo

Attach to the screen screen -r foo

SSL

  1. Stop all screens and containers
  2. sudo service nginx stop
  3. sudo service httpd start
  4. sudo certbot
  5. sudo reboot
  6. sudo service httpd stop
  7. sudo service nginx start
  8. Start all screens and containers

SSL Reference

Docker Stuff

docker build --build-arg server_port=8445 . -t twitch-bot:membtv

docker build --build-arg server_port=8446 . -t twitch-bot:itsatreee

About

This repo holds all the various things a streamer would want from integration with Twitch and Bttv

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •