aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/admin/shout.js
blob: 736134a415722a97c56afe7502d6f2519191995e (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
/*
  Description: Emmits a server-wide message as `info`
*/

'use strict';

exports.run = async (core, server, socket, data) => {
  if (socket.uType != 'admin') {
    // ignore if not admin
    return;
  }

  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'
};