From 39a10c131a566595ee05d00db5753c2098fb468e Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Tue, 21 May 2013 13:20:26 +0000 Subject: [PATCH] Add CTCP commands. Add a few more basic CTCP commands, notably CLIENTINFO, telling one what commands dbot supports. Fixes/goes towards fixing #268. --- modules/ctcp/ctcp.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/ctcp/ctcp.js b/modules/ctcp/ctcp.js index 09af4d8..fe02dde 100644 --- a/modules/ctcp/ctcp.js +++ b/modules/ctcp/ctcp.js @@ -1,7 +1,19 @@ var ctcp = function(dbot) { var commands = { "\x01VERSION\x01": function(event) { + // the current client version event.replyNotice("\x01VERSION " + dbot.config.version + "\x01"); + }, + "\x01CLIENTINFO\x01": function(event){ + // a list of all supported CTCP commands + event.replyNotice("\x01CLIENTINFO SOURCE VERSION USERINFO\x01"); + }, + "\x01SOURCE\x01": function(event){ + event.replyNotice("\x01SOURCE https://github.com/reality/depressionbot\x01"); + }, + "\x01USERINFO\x01": function(event){ + // a "witty" saying set by the user + event.replyNotice("\z01USERINFO " + dbot.config.name + "\x01"); } } this.commands = commands;