Add command /clear.

This commit is contained in:
Juliusz Chroboczek
2020-04-30 19:13:10 +02:00
parent fd1772ed72
commit 10526d474e
3 changed files with 25 additions and 0 deletions
+12
View File
@@ -435,6 +435,9 @@ function serverConnect() {
case 'chat':
addToChatbox(m.id, m.username, m.value, m.me);
break;
case 'clearchat':
resetChat();
break;
case 'ping':
send({
type: 'pong',
@@ -750,6 +753,15 @@ function handleInput() {
case '/leave':
socket.close();
return;
case '/clear':
if(!permissions.op) {
displayError("You're not an operator");
return;
}
send({
type: 'clearchat',
});
return;
case '/op':
case '/unop':
case '/kick':