1
Fork 0

Implement commands /warn and /wall.

This commit is contained in:
Juliusz Chroboczek 2020-11-30 15:48:23 +01:00
parent ed531cefc2
commit d98c9b95b2
1 changed files with 20 additions and 0 deletions

View File

@ -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'));