From 2b186dfc437002222589725f75aa95877ebb2907 Mon Sep 17 00:00:00 2001 From: Sarimoko Date: Sun, 13 Feb 2022 05:08:39 +0000 Subject: [PATCH] Update 'www/boto.js' --- www/boto.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/www/boto.js b/www/boto.js index 5114e72..58cfc88 100644 --- a/www/boto.js +++ b/www/boto.js @@ -22,13 +22,18 @@ const users = {}; client.on('message', (channel, tags, message, self) => { if(self) return; const { username } = tags; - if (username === 'sarimoko' && message === '!start-count') { - listeningForCount = true; - } else if (username === 'sarimoko' && message === '!end-count'){ + if (username === 'sarimoko' || username === 'sariboto') { + if (message === '!start-count') { + listeningForCount = true; + } else if (message === '!end-count'){ listeningForCount= false; // say count out loud - } - else if (listeningForCount && message === '+1') { + }else if (message === '!clear-count'){ + listeningForCount= false; + countElement.textContent = 'Waiting for count...'; + userElement.textContent = ''; + } + } else if (listeningForCount && message === '+1') { users[tags.username] = true; // display current count page. countElement.textContent = Object.keys(users).length;