aboutsummaryrefslogtreecommitdiffstats
path: root/server/commands/admin/shout.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/commands/admin/shout.js')
-rw-r--r--server/commands/admin/shout.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/server/commands/admin/shout.js b/server/commands/admin/shout.js
new file mode 100644
index 0000000..1358dd9
--- /dev/null
+++ b/server/commands/admin/shout.js
@@ -0,0 +1,23 @@
+/*
+ Description: Emmits a server-wide message as `info`
+*/
+
+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'
+}; \ No newline at end of file