From 8c828213d07d7a4213f667eb278708be59130b20 Mon Sep 17 00:00:00 2001 From: Joe MacMahon Date: Sat, 9 Feb 2013 16:44:05 +0000 Subject: [PATCH] Added CTCP VERSION responding. New config option for version. --- config.json.sample | 3 ++- jsbot | 2 +- modules/ctcp/README.md | 5 +++++ modules/ctcp/config.json | 3 +++ modules/ctcp/ctcp.js | 13 +++++++++++++ 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 modules/ctcp/README.md create mode 100644 modules/ctcp/config.json create mode 100644 modules/ctcp/ctcp.js diff --git a/config.json.sample b/config.json.sample index 05c37a4..21431dc 100644 --- a/config.json.sample +++ b/config.json.sample @@ -15,5 +15,6 @@ "moderators": [ "whatever" ], "moduleNames": [ "ignore", "admin", "command", "dice", "js", "kick", "quotes", "spelling", "youare", "stats", "users" ], "language": "english", - "debugMode": true + "debugMode": true, + "version": "Depressionbot IRC Bot 0.4-dev. https://github.com/reality/depressionbot/" } diff --git a/jsbot b/jsbot index 27d57d8..2c255c3 160000 --- a/jsbot +++ b/jsbot @@ -1 +1 @@ -Subproject commit 27d57d8589c13b464780b4c5ce5ce3675cc2a7f2 +Subproject commit 2c255c34ef35e9edf8cd8bd947269efd6f166b2f diff --git a/modules/ctcp/README.md b/modules/ctcp/README.md new file mode 100644 index 0000000..91b0718 --- /dev/null +++ b/modules/ctcp/README.md @@ -0,0 +1,5 @@ +## CTCP +Responds to CTCP commands. + +## Description +At the moment only CTCP VERSION, CTCP PING is handled in JSBot. \ No newline at end of file diff --git a/modules/ctcp/config.json b/modules/ctcp/config.json new file mode 100644 index 0000000..c945e96 --- /dev/null +++ b/modules/ctcp/config.json @@ -0,0 +1,3 @@ +{ + "ignorable": true +} diff --git a/modules/ctcp/ctcp.js b/modules/ctcp/ctcp.js new file mode 100644 index 0000000..09af4d8 --- /dev/null +++ b/modules/ctcp/ctcp.js @@ -0,0 +1,13 @@ +var ctcp = function(dbot) { + var commands = { + "\x01VERSION\x01": function(event) { + event.replyNotice("\x01VERSION " + dbot.config.version + "\x01"); + } + } + this.commands = commands; + this.on = 'PRIVMSG'; +}; + +exports.fetch = function(dbot) { + return new ctcp(dbot); +};