From b4146cfc8cba6b9313cb1bda42ddbf0d630471eb Mon Sep 17 00:00:00 2001 From: Leppunen Date: Tue, 15 Dec 2020 16:42:34 +0200 Subject: [PATCH] Change password format and add completion messages --- index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 297d503..1fcedd1 100644 --- a/index.js +++ b/index.js @@ -23,7 +23,7 @@ const sleep = (ms) => { const createTwitchClient = () => { return new ChatClient({ username: Config.Username, - password: `oauth:${Config.Password}`, + password: Config.Password, rateLimits: 'verifiedBot', }); }; @@ -64,11 +64,11 @@ const getConnection = () => { } if (statusCode === 401) { - return clients[1].say(msg.channelName, 'Authorization token is invalid'); + return clients[0].say(msg.channelName, 'Authorization token is invalid'); } if (statusCode !== 200) { - return clients[1].say(msg.channelName, 'Unexpected error occurred.'); + return clients[0].say(msg.channelName, 'Unexpected error occurred.'); } const banArr = body.split('\n'); @@ -84,11 +84,13 @@ const getConnection = () => { } await sleep(Config.DelayPerChunk); } + clients[0].say(msg.channelName, `List ${listID} ran successfully on channel ${channel || msg.channelName}`); banChunks = []; } else { for (const entry of banArr) { getConnection().privmsg(channel || msg.channelName, entry); } + clients[0].say(msg.channelName, `List ${listID} ran successfully on channel ${channel || msg.channelName}`); } } });