1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-10 02:35:58 +01:00

Implement commands /warn and /wall.

This commit is contained in:
Juliusz Chroboczek 2020-11-30 15:48:23 +01:00
parent ed531cefc2
commit d98c9b95b2

View file

@ -1828,6 +1828,26 @@ commands.mute = {
f: userMessage, 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() { function handleInput() {
let input = /** @type {HTMLTextAreaElement} */ let input = /** @type {HTMLTextAreaElement} */
(document.getElementById('input')); (document.getElementById('input'));