aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/admin/shout.js
blob: 80a6470cf9081fabbf56a5ff96e3415d7bbf9f9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
  Description: Emmits a server-wide message as `info`
*/

exports.run = async (core, server, socket, data) => {
  // increase rate limit chance and ignore if not admin
  if (socket.uType != 'admin') {
    server._police.frisk(socket.remoteAddress, 20);

    return;
  }

  // send text to all channels
  server.broadcast({
    cmd: 'info',
    text: `Server Notice: ${data.text}`
  }, {});
};

exports.requiredData = ['text'];

exports.info = {
  name: 'shout',
  usage: 'shout {text}',
  description: 'Displays passed text to every client connected'
};