add /shrug command

This commit is contained in:
maia arson crimew 2022-02-18 15:19:28 +01:00
parent eae224e3d5
commit 2c992d49f0

View file

@ -153,13 +153,23 @@ const setupChatboxEvents = (socket) => {
printChatMessage("set-time", "/sync", "b57fdc", syncMessageContent); printChatMessage("set-time", "/sync", "b57fdc", syncMessageContent);
handled = true; handled = true;
break; break;
case "/shrug":
socket.send(
JSON.stringify({
op: "ChatMessage",
data: `${args} ¯\\_(ツ)_/¯`.trim(),
})
);
handled = true;
break;
case "/help": case "/help":
const helpMessageContent = document.createElement("span"); const helpMessageContent = document.createElement("span");
helpMessageContent.innerHTML = helpMessageContent.innerHTML =
"Available commands:<br>" + "Available commands:<br>" +
"&emsp;<code>/help</code> - display this help message<br>" + "&emsp;<code>/help</code> - display this help message<br>" +
"&emsp;<code>/ping [message]</code> - ping all viewers<br>" + "&emsp;<code>/ping [message]</code> - ping all viewers<br>" +
"&emsp;<code>/sync</code> - resyncs you with other viewers"; "&emsp;<code>/sync</code> - resyncs you with other viewers<br>" +
"&emsp;<code>/shrug</code> - appends ¯\\_(ツ)_/¯ to your message";
printChatMessage( printChatMessage(
"command-message", "command-message",