web js
This commit is contained in:
parent
fda40712de
commit
eb13805d8c
|
@ -27,14 +27,16 @@ client.on('message', (wat, tags, message, self) => {
|
||||||
if (self) return;
|
if (self) return;
|
||||||
const { username } = tags;
|
const { username } = tags;
|
||||||
if (username.toLowerCase() === channel.toLowerCase()) {
|
if (username.toLowerCase() === channel.toLowerCase()) {
|
||||||
if (message === '!start-count') {
|
if (message === '!start') {
|
||||||
listeningForCount = true;
|
listeningForCount = true;
|
||||||
} else if (message === '!end-count') {
|
}
|
||||||
|
else if (message === '!end') {
|
||||||
listeningForCount = false;
|
listeningForCount = false;
|
||||||
// say count out loud.
|
// say count out loud.
|
||||||
const sayCount = new SpeechSynthesisUtterance(Object.keys(users).length);
|
const sayCount = new SpeechSynthesisUtterance(Object.keys(users).length);
|
||||||
window.speechSynthesis.speak(sayCount);
|
window.speechSynthesis.speak(sayCount);
|
||||||
} else if (message === '!clear-count') {
|
}
|
||||||
|
else if (message === '!clear') {
|
||||||
countElement.textContent = 'Waiting for count...';
|
countElement.textContent = 'Waiting for count...';
|
||||||
usersElement.textContent = '';
|
usersElement.textContent = '';
|
||||||
users = {};
|
users = {};
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<marquee><p>Type 1 in the chat!</p></marquee>
|
<marquee><p>Type 1 in the chat!</p></marquee>
|
||||||
<em>(broadcaster only)</em>
|
<em>(broadcaster only)</em>
|
||||||
<br />
|
<br />
|
||||||
<code>!start-count | !end-count | !clear-count</code>
|
<code>!start | !end | !clear</code>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
</center>
|
</center>
|
||||||
|
|
Loading…
Reference in New Issue