/tannerdinobot

twitch chat bot

Primary LanguageJavaScript

Bot Configuration

To use this bot, you need to set up the configuration file config.json with the following variables:

  • twitch_username: Twitch bot username or displayname.
  • twitch_password: OAuth token for your Twitch Bot account.
  • twitch_oauth: OAuth token for your main Twitch account.
  • twitch_channel: Twitch channel your Twitch bot will talk in.
  • dbPath: Path to the game database file (loottracker.db).
  • clientId: Twitch Client ID for API authentication.

Variables

  1. Twitch Username:

    • Create a new account through Twitch, this will be your bot.
    • Enter the desired Twitch bot username.
    • It should be the username associated with your Twitch bot account.
    • Example: tannerdinobot
  2. Twitch Bot OAuth Token:

    • Make sure you're signed into your Twitch Bot account
    • Visit the Twitch Chat OAuth Password Generator page: https://twitchapps.com/tmi/
    • Click on the "Connect with Twitch" button and authorize the app to access your account.
    • Copy the OAuth token generated by the website.
    • Example: OAuth:rfx2uswqe8l4g1mkagrvg5tv0ks3
  3. Twitch Main OAuth Token:

    • Make sure you're signed into your main Twitch account
    • Visit the Twitch Chat OAuth Password Generator page: https://twitchapps.com/tmi/
    • Click on the "Connect with Twitch" button and authorize the app to access your account.
    • Copy the OAuth token generated by the website.
    • Example: rfx2uswqe8l4g1mkagrvg5tv0ks3
  4. Twitch Channel:

    • Enter the Twitch channel you want the bot to join.
    • Example: tannerdino
  5. Game Database Path:

    • Navigate to C:\Users\NAME\AppData\Local\Jagex\Old School RuneScape\users\
    • Look for a folder named with a bunch of numbers.
    • In this folder you should find the loottracker.db
    • This is the path where the game stores the loot tracker database file.
    • Example: C:\Users\NAME\AppData\Local\Jagex\Old School RuneScape\users\NUMBERS\loottracker.db
  6. Twitch Client ID:

Setting up the config

  • Open Command Prompt (cmd) on your computer.
  • Navigate to the directory where you have your bot code and configuration file. For example, if your bot code is located in C:\MyBot and the configuration file config.json is in that directory, you can navigate to it by running the following command:
    cd MyBot\src\config
    
  • Copy and paste the following command into cmd and press Enter to create a new config.json file:
    echo { "twitch": { "username": "", "password": "", "oauth": "", "channels": [], "dbPath": "", "clientId": "" } } > config.json
    
  • Replace the empty fields (username, password, oauth, channels, dbPath, and clientId) with your desired values.
  1. Once you have set all the required values in the config.json file, you can proceed with running your bot code.

Running the bot

  • Open Command Prompt (cmd) on your computer.
  • Navigate to your Twitch bots directory with the command:
cd MyBot\src
  • Run index.js to start the bot:
node index.js
  • Command Prompt should relay a message along the lines of Connected to irc-ws.chat.twitch.tv:443