diff options
Diffstat (limited to 'webchat/public/commands.js')
-rw-r--r-- | webchat/public/commands.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/webchat/public/commands.js b/webchat/public/commands.js new file mode 100644 index 00000000..8cd3bba1 --- /dev/null +++ b/webchat/public/commands.js @@ -0,0 +1,25 @@ +var commands = {} + +commands.say = function (settings, params) { + var sendObj = { + method: 'say', + params: { message: params }, + }; + sock.send(JSON.stringify(sendObj)) +} + +commands.nick = function (settings, params) { + settings.nick = params + var sendObj = { + method: 'nick', + params: { nick: params }, + } + sock.send(JSON.stringify(sendObj)) +} + +commands.badcommand = function (settings, params) { + console.log("error"); + chatboxAppend( '<span class="from_system">error</span>', 'command not found' ) + + +} |