diff options
author | lassulus <lassulus@googlemail.com> | 2013-11-12 02:01:29 +0100 |
---|---|---|
committer | lassulus <lassulus@googlemail.com> | 2013-11-12 02:01:29 +0100 |
commit | 3531d46cc3644a64b990f904e40e4846b8242a07 (patch) | |
tree | a0289317e14a8011d7a6615010b70e5d21eff02c /webchat/public/commands.js | |
parent | c6a7cd9027150fca42500b3bbc78be01993856f6 (diff) |
webchat: refactor to rpc
Diffstat (limited to 'webchat/public/commands.js')
-rw-r--r-- | webchat/public/commands.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/webchat/public/commands.js b/webchat/public/commands.js index 5a570556..d4408c4c 100644 --- a/webchat/public/commands.js +++ b/webchat/public/commands.js @@ -1,14 +1,15 @@ var commands = {} -commands.say = function (settings, params) { +commands.msg = function (settings, params) { var sendObj = { - method: 'say', - params: { msg: params }, - }; + method: 'msg', + params: { msg: params } + } settings.sock.send(JSON.stringify(sendObj)) } commands.nick = function (settings, params) { + settings.nick = params var sendObj = { method: 'nick', params: { nick: params }, @@ -17,7 +18,7 @@ commands.nick = function (settings, params) { } commands.badcommand = function (settings, params) { - console.log("error"); + console.log("error", params); chatboxAppend( '<span class="from_system">error</span>', 'command not found' ) |