Assumptions

Includes

Create a new Twitch account for the chatbot

  1. Create a new Twitch account for the chatbot at https://www.twitch.tv/
    1. Go to https://www.twitch.tv/settings/security
      1. Enable Two-Factor Authentication (allows it to send you phone SMS or use authenticator app)

Screenshot 2023-03-20 at 4.43.13 PM.png

Register Twitch app

  1. Go to https://dev.twitch.tv/console/apps/create and register a new app

    1. OAuth Redirect URLs — should be http://localhost:3000

    Screenshot 2023-03-20 at 6.01.32 PM.png

  2. Check that your app shows up at https://dev.twitch.tv/console

    Screenshot 2023-03-20 at 4.46.53 PM.png

Set up code repo

  1. In your terminal:
mkdir TwitchChatbot <---------- create new folder called TwitchChatbot
cd TwitchChatbot    <---------- go into that folder 
yarn init           <---------- sets up Yarn and creates package.json file
yarn add dotenv     <---------- for managing secret keys
yarn add tmi.js     <---------- for talking to Twitch API
  1. Open the TwitchChatbot folder in your code editor (Ie. VSCode). Folder structure should look like this now:

    Screenshot 2023-03-20 at 5.08.24 PM.png

  2. Inside package.json, add a line for “type”

{
  "name": "TwitchChatbot",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "type": "module", <----------- add this
  "dependencies": {
    "dotenv": "^16.0.3",
    "tmi.js": "^1.8.5"
  }
}