summaryrefslogtreecommitdiffstats
path: root/webchat/public/commands.js
blob: d4408c4c887cd33cf2f9eef74f09547fcf816556 (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
25
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) {
  settings.nick = 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' )

  
}