]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blob - data/rbot/plugins/botsnack.rb
b391bb9643f92894c4376e3402539e45baea967b
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / botsnack.rb
1 #-- vim:sw=2:et
2 #++
3 #
4 # :title: botsnack - give your bot some love
5 # :version: 1.0
6 #
7 # Author:: Jan Wikholm <jw@jw.fi>
8 #
9 # Copyright:: (C) 2008 Jan Wikholm
10 #
11 # License:: public domain
12 #
13 # TODO More replies
14
15
16
17
18 class BotsnackPlugin < Plugin
19
20   def help(plugin, topic="")
21     "botsnack => reward #{@nick} for being good"
22   end
23
24
25   def snack(m, params)
26     # Below is the 0.9.10 version, but I changed it because it would conflict 
27     # with config params [core.reply_with_nick true] and [core.nick_postfix ,]
28     # resulting in:
29     # <@unfo-> .botsnack
30     # <@rrBot> unfo-, unfo-: thanks :)
31     # OLD: m.reply @bot.lang.get("thanks_X") % m.sourcenick if(m.public?)
32     # OLD: m.reply @bot.lang.get("thanks") if(m.private?)
33     
34     m.reply @bot.lang.get("thanks") 
35   end
36 end
37
38 plugin = BotsnackPlugin.new
39
40 plugin.map "botsnack", :action => :snack, :thread => "yes" #so it won't lock
41