mirror of
https://github.com/hack-chat/main.git
synced 2024-03-22 13:20:33 +08:00
23 lines
553 B
JavaScript
23 lines
553 B
JavaScript
|
/*
|
||
|
Description: Used to relay warnings to clients internally
|
||
|
*/
|
||
|
|
||
|
exports.run = async (core, server, socket, data) => {
|
||
|
if (data.cmdKey !== server._cmdKey) {
|
||
|
// internal command attempt by client, increase rate limit chance and ignore
|
||
|
server._police.frisk(socket.remoteAddress, 20);
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
server.reply({ cmd: 'warn', text: data.text }, socket);
|
||
|
};
|
||
|
|
||
|
exports.requiredData = ['cmdKey', 'text'];
|
||
|
|
||
|
exports.info = {
|
||
|
name: 'socketreply',
|
||
|
usage: 'Internal Use Only',
|
||
|
description: 'Internally used to relay warnings to clients'
|
||
|
};
|