Merge pull request 'Smol fixes' (#2) from zneix/massbanner:fix/smol-fixes into master

Reviewed-on: https://gitea.ivr.fi/Leppunen/massbanner/pulls/2
This commit is contained in:
Leppunen 2021-03-24 08:55:58 +00:00
commit fb804156f4
1 changed files with 4 additions and 2 deletions

View File

@ -67,6 +67,8 @@ const runList = async (listData, listID, channel) => {
banChunks.push(banArr.splice(0, Config.MaxChunkSize)); banChunks.push(banArr.splice(0, Config.MaxChunkSize));
} }
const chunkCount = banChunks.length;
for (const [i, chunk] of banChunks.entries()) { for (const [i, chunk] of banChunks.entries()) {
const promises = []; const promises = [];
@ -84,7 +86,7 @@ const runList = async (listData, listID, channel) => {
break; break;
} }
say(Config.Username, `Chunk ${Number(i) + 1} of ${listID} executed successfully on channel ${channel}`); say(Config.Username, `Chunk ${Number(i) + 1}/${chunkCount} of ${listID} executed successfully on channel ${channel}`);
await sleep(Config.DelayPerChunk); await sleep(Config.DelayPerChunk);
} }
} else { } else {
@ -161,7 +163,7 @@ if (!Config.IgnorePNSL){
clients[i].on('error', (error) => { clients[i].on('error', (error) => {
if (error instanceof SayError) return; if (error instanceof SayError) return;
if (error instanceof UserBanError) { if (error instanceof UserBanError) {
return console.warn(`Failed to ban user ${error.username} from ${error.channelname}`); return console.warn(`Failed to ban user ${error.username} from ${error.channelName}`);
} }
if (error instanceof ConnectionError) { if (error instanceof ConnectionError) {
if (clients[i].ready) { if (clients[i].ready) {