Update client numbering to start from 1

This commit is contained in:
Leppunen 2020-12-15 18:28:04 +02:00
parent b4146cfc8c
commit 4048a878e6

View file

@ -30,7 +30,7 @@ const createTwitchClient = () => {
const sendPong = () => { const sendPong = () => {
for (const [i, client] of Object.entries(clients)) { for (const [i, client] of Object.entries(clients)) {
client.say(Config.Username, `Pong from client ${i}`); client.say(Config.Username, `Pong from client ${Number(i) + 1}`);
} }
}; };
@ -43,7 +43,7 @@ const getConnection = () => {
clients[i] = createTwitchClient(); clients[i] = createTwitchClient();
clients[i].connect(); clients[i].connect();
clients[i].on('ready', async () => { clients[i].on('ready', async () => {
console.log(`${chalk.green('[CONNECTED]')} || Client ${i} Connected to twitch.`); console.log(`${chalk.green('[CONNECTED]')} || Client ${Number(i) + 1} Connected to twitch.`);
await clients[i].join(Config.Username); await clients[i].join(Config.Username);
}); });
}); });