tmijs / tmi.js

💬 Javascript library for the Twitch Messaging Interface. (Twitch.tv)
https://tmijs.com
MIT License
1.54k stars 216 forks source link

Can't connect to server with OAuth token authorization #527

Closed Artracurs closed 1 year ago

Artracurs commented 1 year ago

Actual behaviour: First, client.say() stopped working, and now it fails to connect to the server at all. (using the standard code from "getting-started" with an OAuth token authorization).

Expected behaviour:

Error log:

[06:18] info: Connecting to irc-ws.chat.twitch.tv on port 443..
[06:18] info: Sending authentication to server..
[06:18] error: Login authentication failed
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Login authentication failed".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Configuration

AlcaDesign commented 1 year ago

How are you getting the access token that you're using? It needs to be a valid user access token with the required chat scope chat:read for reading and the optional chat scope chat:edit for sending.

See Twitch's guides: https://dev.twitch.tv/docs/irc/authenticate-bot

Artracurs commented 1 year ago

I'm sorry for the trouble!... Everything is working!