From 2a96c9198c1f6e13407d0999083f6ce5e0bc06fa Mon Sep 17 00:00:00 2001 From: Tom Gilbert Date: Wed, 27 Jul 2005 16:32:32 +0000 Subject: move rbot into lib - still rearranging for packaging/installation --- lib/rbot/plugins/cal.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/rbot/plugins/cal.rb (limited to 'lib/rbot/plugins/cal.rb') diff --git a/lib/rbot/plugins/cal.rb b/lib/rbot/plugins/cal.rb new file mode 100644 index 00000000..4f28310b --- /dev/null +++ b/lib/rbot/plugins/cal.rb @@ -0,0 +1,15 @@ +class CalPlugin < Plugin + def help(plugin, topic="") + "cal [options] => show current calendar [unix cal options]" + end + def cal(m, params) + if params.has_key?(:month) + m.reply Utils.safe_exec("cal", params[:month], params[:year]) + else + m.reply Utils.safe_exec("cal") + end + end +end +plugin = CalPlugin.new +plugin.map 'cal :month :year', :requirements => {:month => /^\d+$/, :year => /^\d+$/} +plugin.map 'cal' -- cgit v1.2.3