aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--DOCUMENTATION.md1
-rw-r--r--README.md4
-rw-r--r--server/src/commands/admin/addmod.js6
-rw-r--r--server/src/commands/admin/listusers.js5
-rw-r--r--server/src/commands/admin/reload.js5
-rw-r--r--server/src/commands/admin/saveconfig.js5
-rw-r--r--server/src/commands/admin/shout.js6
-rw-r--r--server/src/commands/core/changenick.js6
-rw-r--r--server/src/commands/core/chat.js6
-rw-r--r--server/src/commands/core/disconnect.js5
-rw-r--r--server/src/commands/core/invite.js6
-rw-r--r--server/src/commands/core/join.js6
-rw-r--r--server/src/commands/core/morestats.js5
-rw-r--r--server/src/commands/core/move.js6
-rw-r--r--server/src/commands/core/showcase.js6
-rw-r--r--server/src/commands/core/stats.js5
-rw-r--r--server/src/commands/mod/ban.js6
-rw-r--r--server/src/commands/mod/kick.js6
-rw-r--r--server/src/commands/mod/unban.js6
19 files changed, 21 insertions, 80 deletions
diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md
index eaf3303..c110188 100644
--- a/DOCUMENTATION.md
+++ b/DOCUMENTATION.md
@@ -15,7 +15,6 @@ The commands are to be sent through a websocket to the URL wss://hack.chat/chat-
|`join`|`channel`, `nick`|Places the calling socket into the target channel with the target nick and broadcasts the event to the channel.|
|`morestats`||Sends back the current server's stats to the calling client.|
|`move`|`channel`|This will change the current channel to `channel`.|
-|`showcases`|`echo`|Simple command module template & info|
|`stats`||Sends back legacy server stats to the calling client. Use `morestats` when possible.|
# `mod`
diff --git a/README.md b/README.md
index 9319698..11f83d1 100644
--- a/README.md
+++ b/README.md
@@ -82,7 +82,9 @@ The [documentation](DOCUMENTATION.md) can be useful for making bots etc.
# Contributing
-If you are changing the commands, make sure it is backwards compatible with the legacy client and you update the [documentation doc](DOCUMENTATION.md) accordingly.
+If you are changing the commands, make sure it is backwards compatible with the legacy client and you update the [documentation](DOCUMENTATION.md) accordingly.
+
+If you are making a command, see [the template](server/src/commands/core/showcase.js) for doing so.
## Authors
diff --git a/server/src/commands/admin/addmod.js b/server/src/commands/admin/addmod.js
index 4c13b22..992f9c4 100644
--- a/server/src/commands/admin/addmod.js
+++ b/server/src/commands/admin/addmod.js
@@ -40,8 +40,4 @@ exports.run = async (core, server, socket, data) => {
exports.requiredData = ['trip'];
-exports.info = {
- name: 'addmod',
- usage: 'addmod {trip}',
- description: 'Adds target trip to the config as a mod and upgrades the socket type'
-};
+exports.info = { name: 'addmod' };
diff --git a/server/src/commands/admin/listusers.js b/server/src/commands/admin/listusers.js
index a539a3c..92fa998 100644
--- a/server/src/commands/admin/listusers.js
+++ b/server/src/commands/admin/listusers.js
@@ -32,7 +32,4 @@ exports.run = async (core, server, socket, data) => {
}, socket);
};
-exports.info = {
- name: 'listusers',
- description: 'Outputs all current channels and sockets in those channels'
-};
+exports.info = { name: 'listusers' };
diff --git a/server/src/commands/admin/reload.js b/server/src/commands/admin/reload.js
index 4e22a95..40de059 100644
--- a/server/src/commands/admin/reload.js
+++ b/server/src/commands/admin/reload.js
@@ -28,7 +28,4 @@ exports.run = async (core, server, socket, data) => {
}, { uType: 'mod' });
};
-exports.info = {
- name: 'reload',
- description: '(Re)loads any new commands into memory, outputs errors if any'
-};
+exports.info = { name: 'reload' };
diff --git a/server/src/commands/admin/saveconfig.js b/server/src/commands/admin/saveconfig.js
index ed3a312..116abd6 100644
--- a/server/src/commands/admin/saveconfig.js
+++ b/server/src/commands/admin/saveconfig.js
@@ -30,7 +30,4 @@ exports.run = async (core, server, socket, data) => {
}, { uType: 'mod' });
};
-exports.info = {
- name: 'saveconfig',
- description: 'Saves current config'
-};
+exports.info = { name: 'saveconfig' };
diff --git a/server/src/commands/admin/shout.js b/server/src/commands/admin/shout.js
index 4ebf696..2efff32 100644
--- a/server/src/commands/admin/shout.js
+++ b/server/src/commands/admin/shout.js
@@ -16,8 +16,4 @@ exports.run = async (core, server, socket, data) => {
exports.requiredData = ['text'];
-exports.info = {
- name: 'shout',
- usage: 'shout {text}',
- description: 'Displays passed text to every client connected'
-};
+exports.info = { name: 'shout' };
diff --git a/server/src/commands/core/changenick.js b/server/src/commands/core/changenick.js
index 4041bb0..94ae4d4 100644
--- a/server/src/commands/core/changenick.js
+++ b/server/src/commands/core/changenick.js
@@ -81,8 +81,4 @@ exports.run = async (core, server, socket, data) => {
exports.requiredData = ['nick'];
-exports.info = {
- name: 'changenick',
- usage: 'changenick {nick}',
- description: 'This will change your current connections nickname'
-};
+exports.info = { name: 'changenick' };
diff --git a/server/src/commands/core/chat.js b/server/src/commands/core/chat.js
index 4e95940..36a98e8 100644
--- a/server/src/commands/core/chat.js
+++ b/server/src/commands/core/chat.js
@@ -55,8 +55,4 @@ exports.run = async (core, server, socket, data) => {
exports.requiredData = ['text'];
-exports.info = {
- name: 'chat',
- usage: 'chat {text}',
- description: 'Broadcasts passed `text` field to the calling users channel'
-};
+exports.info = { name: 'chat' };
diff --git a/server/src/commands/core/disconnect.js b/server/src/commands/core/disconnect.js
index 41ca380..9e733fa 100644
--- a/server/src/commands/core/disconnect.js
+++ b/server/src/commands/core/disconnect.js
@@ -15,7 +15,4 @@ exports.run = async (core, server, socket, data) => {
socket.terminate();
};
-exports.info = {
- name: 'disconnect',
- description: 'Event handler or force disconnect (if your into that kind of thing)'
-};
+exports.info = { name: 'disconnect' };
diff --git a/server/src/commands/core/invite.js b/server/src/commands/core/invite.js
index 735dace..3fbbe6e 100644
--- a/server/src/commands/core/invite.js
+++ b/server/src/commands/core/invite.js
@@ -58,8 +58,4 @@ exports.run = async (core, server, socket, data) => {
exports.requiredData = ['nick'];
-exports.info = {
- name: 'invite',
- usage: 'invite {nick}',
- description: 'Generates a unique (more or less) room name and passes it to two clients'
-};
+exports.info = { name: 'invite' };
diff --git a/server/src/commands/core/join.js b/server/src/commands/core/join.js
index b385b89..b72824b 100644
--- a/server/src/commands/core/join.js
+++ b/server/src/commands/core/join.js
@@ -128,8 +128,4 @@ exports.run = async (core, server, socket, data) => {
exports.requiredData = ['channel', 'nick'];
-exports.info = {
- name: 'join',
- usage: 'join {channel} {nick}',
- description: 'Place calling socket into target channel with target nick & broadcast event to channel'
-};
+exports.info = { name: 'join' };
diff --git a/server/src/commands/core/morestats.js b/server/src/commands/core/morestats.js
index c1105f1..ce0e87d 100644
--- a/server/src/commands/core/morestats.js
+++ b/server/src/commands/core/morestats.js
@@ -47,7 +47,4 @@ exports.run = async (core, server, socket, data) => {
core.managers.stats.increment('stats-requested');
};
-exports.info = {
- name: 'morestats',
- description: 'Sends back current server stats to the calling client'
-};
+exports.info = { name: 'morestats' };
diff --git a/server/src/commands/core/move.js b/server/src/commands/core/move.js
index 9e50f4f..9462468 100644
--- a/server/src/commands/core/move.js
+++ b/server/src/commands/core/move.js
@@ -76,8 +76,4 @@ exports.run = async (core, server, socket, data) => {
exports.requiredData = ['channel'];
-exports.info = {
- name: 'move',
- usage: 'move {channel}',
- description: 'This will change the current channel to the new one provided'
-};
+exports.info = { name: 'move' };
diff --git a/server/src/commands/core/showcase.js b/server/src/commands/core/showcase.js
index 35d811a..1f2cdd9 100644
--- a/server/src/commands/core/showcase.js
+++ b/server/src/commands/core/showcase.js
@@ -43,9 +43,7 @@ exports.init = (core) => {
exports.requiredData = ['echo'];
// optional parameters are marked, all others are required
-exports.info = {
+exports.info = {
name: 'showcase', // actual command name
- aliases: ['templateModule'], // optional, an array of other names this module can be executed by
- usage: 'showcase {echo}', // used for help output, can be ommited if no parameters are required
- description: 'Simple command module template & info' // used for help output
+ aliases: ['templateModule']
};
diff --git a/server/src/commands/core/stats.js b/server/src/commands/core/stats.js
index 3a96381..2802579 100644
--- a/server/src/commands/core/stats.js
+++ b/server/src/commands/core/stats.js
@@ -26,7 +26,4 @@ exports.run = async (core, server, socket, data) => {
core.managers.stats.increment('stats-requested');
};
-exports.info = {
- name: 'stats',
- description: 'Sends back legacy server stats to the calling client'
-};
+exports.info = { name: 'stats' };
diff --git a/server/src/commands/mod/ban.js b/server/src/commands/mod/ban.js
index e19efc2..b2749ae 100644
--- a/server/src/commands/mod/ban.js
+++ b/server/src/commands/mod/ban.js
@@ -57,8 +57,4 @@ exports.run = async (core, server, socket, data) => {
exports.requiredData = ['nick'];
-exports.info = {
- name: 'ban',
- usage: 'ban {nick}',
- description: 'Disconnects the target nickname in the same channel as calling socket & adds to ratelimiter'
-};
+exports.info = { name: 'ban' };
diff --git a/server/src/commands/mod/kick.js b/server/src/commands/mod/kick.js
index 1797ba9..5c72160 100644
--- a/server/src/commands/mod/kick.js
+++ b/server/src/commands/mod/kick.js
@@ -71,8 +71,4 @@ exports.run = async (core, server, socket, data) => {
exports.requiredData = ['nick'];
-exports.info = {
- name: 'kick',
- usage: 'kick {nick}',
- description: 'Silently forces target client(s) into another channel. `nick` may be string or array of strings'
-};
+exports.info = { name: 'kick' };
diff --git a/server/src/commands/mod/unban.js b/server/src/commands/mod/unban.js
index d63288e..5450858 100644
--- a/server/src/commands/mod/unban.js
+++ b/server/src/commands/mod/unban.js
@@ -48,8 +48,4 @@ exports.run = async (core, server, socket, data) => {
core.managers.stats.decrement('users-banned');
};
-exports.info = {
- name: 'unban',
- usage: 'unban {[ip || hash]}',
- description: 'Removes target ip from the ratelimiter'
-};
+exports.info = { name: 'unban' };