summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/figlet.rb
blob: f82288eb65356cb06dd9ec7cb57d073d713781e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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")