forked from GitHub/dbot
rookie mistake
This commit is contained in:
parent
d1b764d4ec
commit
2f6dc6f25f
@ -71,19 +71,19 @@ var warning = function(dbot) {
|
|||||||
var warns = {};
|
var warns = {};
|
||||||
|
|
||||||
dbot.api.users.getUserAliases(warnee.id, function(err, aliases) {
|
dbot.api.users.getUserAliases(warnee.id, function(err, aliases) {
|
||||||
var alia = aliases.push(warnee.primaryNick);
|
aliases.push(warnee.primaryNick);
|
||||||
this.db.search('notifies', {
|
|
||||||
|
dbot.modules.report.db.search('notifies', {
|
||||||
'server': event.server,
|
'server': event.server,
|
||||||
'type': 'warn'
|
'type': 'warn'
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
if(_.include(alia, result.target)) {
|
if(_.include(aliases, result.target)) {
|
||||||
warns[result.time] = result;
|
warns[result.time] = result;
|
||||||
}
|
}
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
var sTimes = _.keys(warns).sort(function(a, b) {
|
var sTimes = _.keys(warns).sort(function(a, b) {
|
||||||
return parseInt(a) - parseInt(b);
|
return parseInt(a) - parseInt(b);
|
||||||
});
|
});
|
||||||
event.reply(_.keys(sTimes));
|
|
||||||
|
|
||||||
if(index <= sTimes.length && index >= 0) {
|
if(index <= sTimes.length && index >= 0) {
|
||||||
this.db.del('notifies', warns[sTimes[index]], function(err) {
|
this.db.del('notifies', warns[sTimes[index]], function(err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user