summaryrefslogtreecommitdiffstats
path: root/webchat/public/commands.js
blob: f19c78dc2f5235046ba9fea1b4c252b66da8873f (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
var commands = {}

commands.msg = function (settings, params) {
  var sendObj = {
    method: 'msg',
    params: { msg: params }
  }
  settings.sock.send(JSON.stringify(sendObj))
}

commands.nick = function (settings, params) {
  var sendObj = {
    method: 'nick',
    params: { nick: params },
  }
  settings.sock.send(JSON.stringify(sendObj))
}

commands.badcommand = function (settings, params) {
  console.log("error", params);
  chatboxAppend( '<span class="from_system">error</span>', 'command not found' )

  
}