From 3eee7b6de26b38c295ea3a9c0c3aebbd8a8373b2 Mon Sep 17 00:00:00 2001 From: reality Date: Wed, 22 May 2013 17:27:40 +0000 Subject: [PATCH 1/6] fix syntax error in link.config --- modules/link/config.json | 2 +- modules/web/config.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/link/config.json b/modules/link/config.json index 34cc8a0..1e8f6f7 100644 --- a/modules/link/config.json +++ b/modules/link/config.json @@ -2,6 +2,6 @@ "autoTitle": false, "dependencies": [ "command" ], "ignorable": true, - "outputPrefix": "\u00034link\u000f" + "outputPrefix": "\u00032link\u000f", "help": "http://github.com/reality/depressionbot/blob/master/modules/link/README.md" } diff --git a/modules/web/config.json b/modules/web/config.json index e6b635e..d49b7e6 100644 --- a/modules/web/config.json +++ b/modules/web/config.json @@ -1,6 +1,6 @@ { "webHost": "nourishedcloud.com", - "webPort": 8080, + "webPort": 8050, "externalPath": false, "help": "https://github.com/reality/depressionbot/blob/master/modules/web/README.md" } From 6b1546365735a0c49e2e828c4b4308591780058f Mon Sep 17 00:00:00 2001 From: reality Date: Wed, 22 May 2013 17:28:13 +0000 Subject: [PATCH 2/6] fuck you --- modules/web/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/web/config.json b/modules/web/config.json index d49b7e6..e6b635e 100644 --- a/modules/web/config.json +++ b/modules/web/config.json @@ -1,6 +1,6 @@ { "webHost": "nourishedcloud.com", - "webPort": 8050, + "webPort": 8080, "externalPath": false, "help": "https://github.com/reality/depressionbot/blob/master/modules/web/README.md" } From 27ace10fe91defa95168538272e1403c17d7ae23 Mon Sep 17 00:00:00 2001 From: reality Date: Wed, 22 May 2013 17:37:07 +0000 Subject: [PATCH 3/6] new outputprefixes --- modules/imgur/config.json | 3 ++- modules/reddit/config.json | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 modules/reddit/config.json diff --git a/modules/imgur/config.json b/modules/imgur/config.json index 853aa84..dc77624 100644 --- a/modules/imgur/config.json +++ b/modules/imgur/config.json @@ -8,5 +8,6 @@ "autoadd": { "e49e686582ce3f60cb51d00c10924861": "facebookman", "b11b634c74562bcd4e5d17b0d90987be": "raffleguy" - } + }, + "outputPrefix": "\u00038imgur\u000f" } diff --git a/modules/reddit/config.json b/modules/reddit/config.json new file mode 100644 index 0000000..f934fa5 --- /dev/null +++ b/modules/reddit/config.json @@ -0,0 +1,3 @@ +{ + "outputPrefix": "\u000312reddit\u000f" +} From 06c14d4fc54300cee127e29f92f1ed2e95f7ac2f Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 23 May 2013 12:15:25 +0000 Subject: [PATCH 4/6] imgur info string [#462] --- modules/imgur/imgur.js | 2 +- modules/imgur/strings.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index 8e54d03..0be68c3 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -111,7 +111,7 @@ var imgur = function(dbot) { if(matches[1]) { this.api.getImageInfo(matches[1], function(imgData) { var info = this.internalAPI.infoString(imgData); - if(info) event.reply('[' + info + ']'); + if(info) event.reply(dbot.t('imgurinfo', { 'info': info }); }.bind(this)); } }.bind(this); diff --git a/modules/imgur/strings.json b/modules/imgur/strings.json index 869c806..9f1ca99 100644 --- a/modules/imgur/strings.json +++ b/modules/imgur/strings.json @@ -3,5 +3,8 @@ "en": "might be NSFW", "na'vi": "kxawm ke wivìntxu evengur", "nl": "bevat mogelijk gevoelige beelden" + }, + "imgurinfo": { + "en": "[{info}]" } } From 9792daf66932a70ba49f3264ab0ee29f19027c1a Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 23 May 2013 12:16:43 +0000 Subject: [PATCH 5/6] syntax error.. --- modules/imgur/imgur.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index 0be68c3..1a3ded1 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -111,7 +111,7 @@ var imgur = function(dbot) { if(matches[1]) { this.api.getImageInfo(matches[1], function(imgData) { var info = this.internalAPI.infoString(imgData); - if(info) event.reply(dbot.t('imgurinfo', { 'info': info }); + if(info) event.reply(dbot.t('imgurinfo', { 'info': info })); }.bind(this)); } }.bind(this); From 1e2a823ef2b1098af9e6b83ca4401a173b9e1c87 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 25 May 2013 19:13:35 +0000 Subject: [PATCH 6/6] Initial logging module [#336] --- modules/command/command.js | 1 + modules/log/config.json | 7 +++++++ modules/log/log.js | 24 ++++++++++++++++++++++++ modules/log/strings.json | 5 +++++ 4 files changed, 37 insertions(+) create mode 100644 modules/log/config.json create mode 100644 modules/log/log.js create mode 100644 modules/log/strings.json diff --git a/modules/command/command.js b/modules/command/command.js index 776299c..cab3439 100644 --- a/modules/command/command.js +++ b/modules/command/command.js @@ -51,6 +51,7 @@ var command = function(dbot) { }); } } + dbot.api.event.emit('command', [ event ]); dbot.save(); } else { if(commandName !== '~') { diff --git a/modules/log/config.json b/modules/log/config.json new file mode 100644 index 0000000..d4b8475 --- /dev/null +++ b/modules/log/config.json @@ -0,0 +1,7 @@ +{ + "logChannel": { + "aberwiki": "#dbot" + }, + "ignorable": false, + "dependencies": [ "event", "command" ] +} diff --git a/modules/log/log.js b/modules/log/log.js new file mode 100644 index 0000000..a799672 --- /dev/null +++ b/modules/log/log.js @@ -0,0 +1,24 @@ +/** + * Name: Log + * Description: Log commands to a channel. + */ +var _ = require('underscore')._; + +var log = function(dbot) { + this.onLoad = function() { + dbot.api.event.addHook('command', function(event) { + var logChannel = this.config.logChannel[event.server]; + if(logChannel) { + dbot.say(event.server, logChannel, dbot.t('log_message', { + 'time': new Date().toUTCString(), + 'command': event.message, + 'user': event.user + })); + } + }.bind(this)); + }.bind(this); +}; + +exports.fetch = function(dbot) { + return new log(dbot); +}; diff --git a/modules/log/strings.json b/modules/log/strings.json new file mode 100644 index 0000000..c25d7a8 --- /dev/null +++ b/modules/log/strings.json @@ -0,0 +1,5 @@ +{ + "log_message": { + "en": "[{time}] {user}: {command}" + } +}