Permalink
Browse files

[beer] Disable giving beer to yourself (issue #64)

  • Loading branch information...
1 parent 58dcc77 commit 7bfe7fce249e145a7977324ff22de90706f8ae40 @mmalecki mmalecki committed Oct 15, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/listeners/beer.js
View
@@ -18,6 +18,12 @@ var beer = module.exports = function () {
res;
if (res = re.exec(data.text)) {
+ if (res[1] == data.nick) {
+ return self.emit('sendMsg', {
+ dest: data.to,
+ msg: "You can't give karma to yourself!"
+ });
+ }
self.karma[res[1]] || (self.karma[res[1]] = 0);
if (res[2] == '++') {
++self.karma[res[1]];

0 comments on commit 7bfe7fc

Please sign in to comment.