3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 11:42:36 +01:00

Merge github.com:reality/depressionbot into database

This commit is contained in:
reality 2013-05-25 21:05:45 +00:00
commit 712db49274
8 changed files with 46 additions and 2 deletions

View File

@ -50,6 +50,7 @@ var command = function(dbot) {
});
}
}
dbot.api.event.emit('command', [ event ]);
dbot.save();
} else {
if(commandName !== '~') {

View File

@ -8,5 +8,6 @@
"autoadd": {
"e49e686582ce3f60cb51d00c10924861": "facebookman",
"b11b634c74562bcd4e5d17b0d90987be": "raffleguy"
}
},
"outputPrefix": "\u00038imgur\u000f"
}

View File

@ -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);

View File

@ -3,5 +3,8 @@
"en": "might be NSFW",
"na'vi": "kxawm ke wivìntxu evengur",
"nl": "bevat mogelijk gevoelige beelden"
},
"imgurinfo": {
"en": "[{info}]"
}
}

7
modules/log/config.json Normal file
View File

@ -0,0 +1,7 @@
{
"logChannel": {
"aberwiki": "#dbot"
},
"ignorable": false,
"dependencies": [ "event", "command" ]
}

24
modules/log/log.js Normal file
View File

@ -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);
};

5
modules/log/strings.json Normal file
View File

@ -0,0 +1,5 @@
{
"log_message": {
"en": "[{time}] {user}: {command}"
}
}

View File

@ -0,0 +1,3 @@
{
"outputPrefix": "\u000312reddit\u000f"
}