]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
plugin(points): disregard self after stripping color codes
authorMatthias Hecker <mail@apoc.cc>
Sat, 11 Apr 2020 23:39:08 +0000 (01:39 +0200)
committerMatthias Hecker <mail@apoc.cc>
Sat, 11 Apr 2020 23:39:08 +0000 (01:39 +0200)
data/rbot/plugins/points.rb

index 0209fabe28afc7686c2882760f3fb64c0e2a1f55..34af9b5090d1ad4fd7bb076e7e0c8a3aced1fcfe 100644 (file)
@@ -112,6 +112,7 @@ class PointsPlugin < Plugin
       next if v == 0 or /--|\+\+/.match(k)
       # strip invisible formatting characters like bold or color codes
       k = k.gsub(FormattingRx, '')
+      next if k.downcase == m.sourcenick.downcase
       @registry[k] += (v > 0 ? 1 : -1)
       m.reply @bot.lang.get("thanks") if k == @bot.nick && v > 0
       m.reply "#{k} now has #{@registry[k]} points!"