Commit d98c9b95 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Implement commands /warn and /wall.

parent ed531cef
......@@ -1828,6 +1828,26 @@ commands.mute = {
f: userMessage,
};
commands.warn = {
parameters: 'user message',
description: 'send a warning to a user',
predicate: operatorPredicate,
f: (c, r) => {
userMessage('warning', r);
},
};
commands.wall = {
parameters: 'message',
description: 'send a warning to all users',
predicate: operatorPredicate,
f: (c, r) => {
if(!r)
throw new Error('empty message');
serverConnection.userMessage(getUsername(), 'warning', '', r);
},
};
function handleInput() {
let input = /** @type {HTMLTextAreaElement} */
(document.getElementById('input'));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment