summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/rbot/plugins/figlet.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/data/rbot/plugins/figlet.rb b/data/rbot/plugins/figlet.rb
new file mode 100644
index 00000000..f82288eb
--- /dev/null
+++ b/data/rbot/plugins/figlet.rb
@@ -0,0 +1,24 @@
+#DEFAULT_FONT="smslant"
+DEFAULT_FONT="rectangles"
+MAX_WIDTH=68
+
+class FigletPlugin < Plugin
+ def help(plugin, topic="")
+ "figlet [<message>] => print using figlet"
+ end
+ def privmsg(m)
+ case m.params
+ when nil
+ m.reply "incorrect usage: " + help(m.plugin)
+ return
+ when (/^-/)
+ m.reply "incorrect usage: " + help(m.plugin)
+ return
+ else
+ m.reply Utils.safe_exec("/usr/bin/figlet", "-k", "-w", "#{MAX_WIDTH}", "-f", DEFAULT_FONT, m.params)
+ return
+ end
+ end
+end
+plugin = FigletPlugin.new
+plugin.register("figlet")