Closed chamberlainpi closed 7 years ago
You haven't filled out any information in the issue message, so I'll assume you're attempting to use of the example set ups?
Make sure your code follows this minimal setup:
Node
var tmi = require('tmi.js');
var client = new tmi.client({
connection: {
reconnect: true,
secure: true
},
options: {
debug: true
},
identity: {
username: '',
password: ''
},
channels: [ 'somechannel' ]
});
client.connect();
Browser
var client = new tmi.client({
connection: {
reconnect: true,
secure: true
},
options: {
debug: true
},
identity: {
username: '',
password: ''
},
channels: [ 'somechannel' ]
});
client.connect();
If you see in the console that it logs its connection, then it's not the library. You need to make sure that the client is connected and has joined a channel before you attempt to use .say()
on a channel.
@AlcaDesign yeah sorry about the accidental submission before I had everything filled out.
With the minimal example you're suggesting, I see there's no credentials used. Won't that mean node won't be able to interact with the chat still?
I tested the minimal example and I'm getting 3 output lines from [info]:
[03:56] info: Connecting to irc-ws.chat.twitch.tv on port 443.. [03:56] info: Sending authentication to server.. [03:56] info: Connected to server.
But since the example didn't tie it to any channels, now it won't respond even if I enter something in the chat with my personal account.
That's because you need to join them first...
I was joining it before when I was using the options.channels
field, but I was just pointing out the example didn't have it.
I think I just found it.... oh god I feel so dumb....
4am, I probably should go to bed. :zzz:
Apologies for bringing up this false alarm!
Well I said it was "minimal" .. Not necessarily the minimal for a chat bot. I just wanted to see if you were able to connect to the servers in the first place. I've updated it to include the identity
and the channels
object.
Thanks for your help.
Yeah I couldn't understand why I could make the connection, but not the authentication. Using idendity
over identity
would certainly break something.
Actual behaviour: When registering a 'chat' event, chat messages are received correctly. But using any client commands like
client.say
throws an error (the Promise'scatch
spits out "Not connected to server.")I did use an oauth password with my bot account, username is all lowercase (I have setup two accounts, one for myself, one for this bot - both using the same email address... could that be a problem?).
Expected behaviour: The bot should be able to send the message to the chat.
Server configuration