Skip to content

Commit

Permalink
Don't trigger points report on unrelated matches
Browse files Browse the repository at this point in the history
  • Loading branch information
earldouglas committed Mar 30, 2017
1 parent b70164d commit c37a847
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lib/listeners/message/points.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ function messageListener(db, from, channel, message) {
} else if (/.+--/.test(split)) {
delta = -1;
}
if (nick === from) {
messages.push({ to: channel
, message: nick + ': You can\'t change your own points.'
});
} else {
messages.push({ to: channel
, message: nick + ' has ' + showPoints(addPoints(nick, delta)) + '.'
});
if (delta !== 0) {
if (nick === from) {
messages.push({ to: channel
, message: nick + ': You can\'t change your own points.'
});
} else {
messages.push({ to: channel
, message: nick + ' has ' + showPoints(addPoints(nick, delta)) + '.'
});
}
}
}
}
Expand Down

0 comments on commit c37a847

Please sign in to comment.