]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blob - data/rbot/plugins/botsnack.rb
plugin(search): fix search and gcalc, closes #28, #29
[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.0a
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 #{@bot.nick} for being good"
22   end
23
24
25   def snack(m, params)
26     if m.public?
27       m.reply @bot.lang.get("thanks_X") % m.sourcenick
28     else
29       m.reply @bot.lang.get("thanks")
30     end
31   end
32 end
33
34 plugin = BotsnackPlugin.new
35
36 plugin.map "botsnack", :action => :snack, :thread => "yes" #so it won't lock
37