[feature] command /anon
This commit is contained in:
parent
817b00cc4a
commit
1ab04cc557
@ -60,6 +60,7 @@ export function run_command(cmd_raw: string, uid: string, users: Map<string, Use
|
|||||||
};
|
};
|
||||||
|
|
||||||
const cmd_set = cmd.split(/\s+/);
|
const cmd_set = cmd.split(/\s+/);
|
||||||
|
const msg = cmd.replace(/^[^\n]+\n/m, '');
|
||||||
|
|
||||||
if (cmd.startsWith('/disconnect')) {
|
if (cmd.startsWith('/disconnect')) {
|
||||||
command_reply('Diconnecting. Bye!',);
|
command_reply('Diconnecting. Bye!',);
|
||||||
@ -178,4 +179,12 @@ export function run_command(cmd_raw: string, uid: string, users: Map<string, Use
|
|||||||
|
|
||||||
command_reply(JSON.stringify(checked_user));
|
command_reply(JSON.stringify(checked_user));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cmd.startsWith('/anon')) {
|
||||||
|
io.in(Array.from(socket.rooms)).emit('new message', {
|
||||||
|
type: 'text-message',
|
||||||
|
data: msg,
|
||||||
|
sender: 'Anonymous User',
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user