diff --git a/modules/command/command.js b/modules/command/command.js index ab4540b..3ad891c 100644 --- a/modules/command/command.js +++ b/modules/command/command.js @@ -50,6 +50,7 @@ var command = function(dbot) { }); } } + dbot.api.event.emit('command', [ event ]); dbot.save(); } else { if(commandName !== '~') { diff --git a/modules/imgur/config.json b/modules/imgur/config.json index 73f36c9..c1899c7 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/imgur/imgur.js b/modules/imgur/imgur.js index 7dc387d..f4595e0 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -110,7 +110,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}]" } } 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}" + } +} 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" +}