Token is valid but bot is failing to connect

Hello,

I am trying to connect a bot to its own channel, to read and edit messages. The authentication token seems valid:
Screenshot_746

But when connecting, it says:
[18:57] info: Connecting to irc-ws.chat.twitch.tv on port 443…
[18:57] info: Sending authentication to server…
[18:57] error: Login authentication failed

Here is the code I’m using:

const tmi = require('tmi.js');

// Define configuration options
const opts = {
    options: { debug: true},
    identity: {
        username: 'krawfbot',
        password: 'oath:mytoken'
  },
  channels: [ 'krawfbot' ]
};

// Create a client with our options
const client = new tmi.client(opts);

// Connect to Twitch:
client.connect();

You have a typo in oath:

it should be oauth:

const opts = {
    options: { debug: true},
    identity: {
        username: 'krawfbot',
        password: 'oauth:mytoken'
  },
  channels: [ 'krawfbot' ]
};

Of course… thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.