Add multiple command channel support

This commit is contained in:
Leppunen 2021-09-06 23:19:16 +03:00
parent 9b39b1833e
commit e5f69a4d72
2 changed files with 6 additions and 1 deletions

View file

@ -5,6 +5,7 @@
"IgnorePNSL": false, "IgnorePNSL": false,
"UseParallelUniverse": true, "UseParallelUniverse": true,
"Users": [], "Users": [],
"Channels": [],
"Prefix": "!!", "Prefix": "!!",
"MaxConnections": 30, "MaxConnections": 30,
"MaxChunkSize": 2000, "MaxChunkSize": 2000,

View file

@ -193,7 +193,11 @@ if (!Config.IgnorePNSL) {
listenClient = createTwitchClient(); listenClient = createTwitchClient();
listenClient.connect(); listenClient.connect();
listenClient.on('ready', async () => { listenClient.on('ready', async () => {
await listenClient.join(`#${Config.Username}`); if (Config.Channels.length === 0) {
await listenClient.join(`#${Config.Username}`);
} else {
await listenClient.joinAll(Config.Channels);
}
console.log(`${chalk.green('[TWITCH]')} || Command listener connected`); console.log(`${chalk.green('[TWITCH]')} || Command listener connected`);
}); });