From 2c992d49f0c030eba81bba300144a45c94b5dac8 Mon Sep 17 00:00:00 2001 From: maia arson crimew Date: Fri, 18 Feb 2022 15:19:28 +0100 Subject: [PATCH] add /shrug command --- frontend/lib/chat.mjs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/lib/chat.mjs b/frontend/lib/chat.mjs index aa53b58..66ebd9a 100644 --- a/frontend/lib/chat.mjs +++ b/frontend/lib/chat.mjs @@ -153,13 +153,23 @@ const setupChatboxEvents = (socket) => { printChatMessage("set-time", "/sync", "b57fdc", syncMessageContent); handled = true; break; + case "/shrug": + socket.send( + JSON.stringify({ + op: "ChatMessage", + data: `${args} ¯\\_(ツ)_/¯`.trim(), + }) + ); + handled = true; + break; case "/help": const helpMessageContent = document.createElement("span"); helpMessageContent.innerHTML = "Available commands:
" + " /help - display this help message
" + " /ping [message] - ping all viewers
" + - " /sync - resyncs you with other viewers"; + " /sync - resyncs you with other viewers
" + + " /shrug - appends ¯\\_(ツ)_/¯ to your message"; printChatMessage( "command-message",