Issue with connecting via twitch.js
Describe the bug Using twitch.js, I get no output from the irc server except a Disconnected unexpectedly error.
To Reproduce Steps to reproduce the behavior:
const ChatClient = require('twitch-chat-client');
const client = ChatClient.anonymous({
hostName: 'irc.fdgt.dev',
})
client.connect();
client.onJoin((channel, user) => {
console.log("Connected");
})
client.onCommunitySub((channel, user, subInfo, msg) => {
console.log(`${channel}, ${user}, onCommunitySub`);
})
client.onSub((channel, user, subInfo, msg) => {
console.log(`${channel}, ${user}, onSub`);
})
client.say('#channel', 'submysterygift.tier3 --giftcount 10');
client.say('#channel', 'subscription --tier 3');
Expected behavior Using the above code, I expect 10 gifted sub events and one tier three regular subscription
Hi, its probably related: I cannot connect with tmi.js either.
This code outputs: Unable to connect.
const tmi = require("tmi.js");
const client = new tmi.Client({
connection: {
server: "irc.fdgt.dev",
},
});
client
.connect()
.then(() => {
console.log("connected");
})
.catch((err) => {
console.error(err);
});
@thomaslule If you’re using tmi on the server-side, you’ll need to add secure: true to your connection config.
const client = new tmi.Client({
connection: {
secure: true,
server: "irc.fdgt.dev",
},
});
That’s a failing of the docs that will be addressed by fdgt-apis/website#27.
@trezy oh thanks that's right, sorry for the noise in this issue
@coolcalcacol I still haven't had a chance to actually verify this bug, but I've got a suspicion that you may need to set the ssl option to true when creating the connection. For example:
const client = ChatClient.anonymous({
ssl: true,
hostName: 'irc.fdgt.dev',
})
Let me know whether or not that solves the issue. If so, I'll update the docs.
ssl is the default... at least it should be.
@d-fischer It is for Twitch, but not for custom servers you have to explicitly mark it secure. I believe it's like that for people running local IRC servers
Where'd you get that idea? I know the opposite is true from being the author of the library.
Suggested fix didn't work, apologies for the delay