- Open a console in a folder/directory of your choice.
git clone https://github.com/Treee/twitch-bot
- Clone the repository Requires Gitnpm install
- Install dependencies. Requires NodeJSnpm run build
- Build the code.npm start
- Run the server to start listening to twitch chat.
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']
}
};
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.
This can be any open port.
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.
This segment is optional and only needed if you want Steam integration with the chatbot. Create Your API Key.
Log in with your account to the web version of Steam. Navigate to your profile.
Find the url and copy the name https://steamcommunity.com/id/{UserName}/
. Use SteamID Finder to locate your Steam Id
from your {UserName}
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.
Create the screen and name it.
screen -S foo
Attach to the screen
screen -r foo
- Stop all screens and containers
sudo service nginx stop
sudo service httpd start
sudo certbot
sudo reboot
sudo service httpd stop
sudo service nginx start
- Start all screens and containers
docker build --build-arg server_port=8445 . -t twitch-bot:membtv
docker build --build-arg server_port=8446 . -t twitch-bot:itsatreee