Skip to content

Instantly share code, notes, and snippets.

@tolekk
Created November 28, 2019 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tolekk/137f97e26368fcd2055a2538f30b3324 to your computer and use it in GitHub Desktop.
Save tolekk/137f97e26368fcd2055a2538f30b3324 to your computer and use it in GitHub Desktop.
Pepega
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