|
|
|
@ -4,6 +4,7 @@ const {
|
|
|
|
|
SlowModeRateLimiter,
|
|
|
|
|
} = require("dank-twitch-irc");
|
|
|
|
|
const { getCommands } = require("../utils/commands");
|
|
|
|
|
const prisma = require("./prisma");
|
|
|
|
|
|
|
|
|
|
let client = new ChatClient({
|
|
|
|
|
username: process.env.TWITCH_USERNAME,
|
|
|
|
@ -20,7 +21,12 @@ console.log("Commands loaded");
|
|
|
|
|
|
|
|
|
|
client.on("ready", async () => {
|
|
|
|
|
console.log("connected to chat");
|
|
|
|
|
client.joinAll([process.env.TWITCH_USERNAME, "rollinjuusto", "catsh"]);
|
|
|
|
|
const channels = await prisma.channel.findMany();
|
|
|
|
|
client.join(process.env.TWITCH_USERNAME);
|
|
|
|
|
for (let channel of channels) {
|
|
|
|
|
console.log("Joining channel: " + channel.name);
|
|
|
|
|
client.join(channel.name);
|
|
|
|
|
}
|
|
|
|
|
console.log("Joined channels");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|