]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/botsnack.rb
plugin(points): new message parser, see #34
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / botsnack.rb
index b391bb9643f92894c4376e3402539e45baea967b..d3097d1b6e026783fe16cdf1cba77e0b3d8eda69 100644 (file)
@@ -2,7 +2,7 @@
 #++
 #
 # :title: botsnack - give your bot some love
-# :version: 1.0
+# :version: 1.0a
 #
 # Author:: Jan Wikholm <jw@jw.fi>
 #
 class BotsnackPlugin < Plugin
 
   def help(plugin, topic="")
-    "botsnack => reward #{@nick} for being good"
+    "botsnack => reward #{@bot.nick} for being good"
   end
 
 
   def snack(m, params)
-    # Below is the 0.9.10 version, but I changed it because it would conflict 
-    # with config params [core.reply_with_nick true] and [core.nick_postfix ,]
-    # resulting in:
-    # <@unfo-> .botsnack
-    # <@rrBot> unfo-, unfo-: thanks :)
-    # OLD: m.reply @bot.lang.get("thanks_X") % m.sourcenick if(m.public?)
-    # OLD: m.reply @bot.lang.get("thanks") if(m.private?)
-    
-    m.reply @bot.lang.get("thanks") 
+    if m.public?
+      m.reply @bot.lang.get("thanks_X") % m.sourcenick
+    else
+      m.reply @bot.lang.get("thanks")
+    end
   end
 end