summaryrefslogtreecommitdiffstats
path: root/webchat/public/commands.js
blob: 20197fbb29c0d76f44f9ba87cd2ee4e8dfcc49cc (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.say = function (settings, params) {
  var sendObj = {
    method: 'say',
    params: { msg: 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' )

  
}