media-server / src /twitchBot.mts
jbilcke-hf's picture
jbilcke-hf HF staff
preparing some audio files
f071343
raw
history blame
572 Bytes
import { ChatClient } from "@kararty/dank-twitch-irc"
const client = new ChatClient({
username: process.env.WEBTV_TWITCH_USERNAME,
password: `oauth:${process.env.WEBTV_TWITCH_API_KEY}`,
})
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("flngr")