diff options
Diffstat (limited to 'webAO/client.js')
| -rw-r--r-- | webAO/client.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/webAO/client.js b/webAO/client.js index d4b6bc9..e3f4d95 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1647,6 +1647,8 @@ async changeBackground(position) { appendICLog(this.chatmsg.content, displayname); + checkCallword(this.chatmsg.content); + // start checking the files try { const { url: speakUrl } = await this.oneSuccess([ @@ -2432,6 +2434,26 @@ function appendICLog(msg, name = "", time = new Date()) { } /** + * check if the message contains an entry on our callword list + * @param {String} message + */ +export function checkCallword(message) { + client.callwords.forEach(testCallword); + + function testCallword(item) + { + if(item !== "" && message.includes(item)) + { + viewport.sfxaudio.pause(); + viewport.sfxaudio.src = AO_HOST + "sounds/general/sfx-gallery.wav"; + viewport.sfxaudio.play(); + } + } +} + + + +/** * Triggered when the music search bar is changed * @param {MouseEvent} event */ |
