summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/botsnack.rb
diff options
context:
space:
mode:
authorJan Wikholm <jw@jw.fi>2008-05-20 19:04:01 +0300
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-05-20 21:38:34 +0200
commitf271ff14104083c0cd0d711ba8a33ece806926ae (patch)
tree90d0d4d33a8a2e56c983cb13370e56587c8c9b27 /data/rbot/plugins/botsnack.rb
parent3aaff245aa49575a3fcb492677b80bb47dc2b762 (diff)
Revival of botsnack functionality as a plugin
The botsnack functionality which was in rbot 0.9.10 core has now been resurrected with love as a plugin. Show your bot some love!
Diffstat (limited to 'data/rbot/plugins/botsnack.rb')
-rw-r--r--data/rbot/plugins/botsnack.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/data/rbot/plugins/botsnack.rb b/data/rbot/plugins/botsnack.rb
new file mode 100644
index 00000000..b391bb96
--- /dev/null
+++ b/data/rbot/plugins/botsnack.rb
@@ -0,0 +1,41 @@
+#-- vim:sw=2:et
+#++
+#
+# :title: botsnack - give your bot some love
+# :version: 1.0
+#
+# Author:: Jan Wikholm <jw@jw.fi>
+#
+# Copyright:: (C) 2008 Jan Wikholm
+#
+# License:: public domain
+#
+# TODO More replies
+
+
+
+
+class BotsnackPlugin < Plugin
+
+ def help(plugin, topic="")
+ "botsnack => reward #{@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")
+ end
+end
+
+plugin = BotsnackPlugin.new
+
+plugin.map "botsnack", :action => :snack, :thread => "yes" #so it won't lock
+