Created
November 28, 2019 14:13
-
-
Save tolekk/137f97e26368fcd2055a2538f30b3324 to your computer and use it in GitHub Desktop.
Pepega
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ChatClient } = require("dank-twitch-irc"); | |
//Config with login and passwd. | |
let client = new ChatClient({ | |
username: "tolekkbot", // justinfan12345 by default - For anonymous chat connection | |
password: "superlongpasswordnam", // undefined by default (no password) | |
rateLimits: "verifiedBot", | |
connection: { | |
type: "tcp", | |
secure: false, | |
host: "irc.chat.twitch.tv", | |
port: 6697 | |
}, | |
maxChannelCountPerConnection: 100, | |
connectionRateLimits: { | |
parallelConnections: 5, | |
releaseTime: 20 * 1000 | |
}, | |
requestMembershipCapability: false, | |
installDefaultMixins: false, | |
ignoreUnhandledPromiseRejections: true | |
}); | |
client.on("ready", () => console.log("Successfully connected to chat")); | |
client.on("close", error => { | |
if (error != null) { | |
console.error("Client closed due to error", error); | |
} | |
}); | |
client.on("PRIVMSG", msg => { | |
console.log(`[#${msg.channelName}] ${msg.displayName}: ${msg.messageText}`); | |
}); | |
// See below for more events | |
client.connect(); | |
client.join("tolekk"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment