diff options
author | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-07-27 16:32:32 +0000 |
---|---|---|
committer | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-07-27 16:32:32 +0000 |
commit | 2a96c9198c1f6e13407d0999083f6ce5e0bc06fa (patch) | |
tree | b3b9247d275d9b554665bc22884104d266d2e757 /lib/rbot/plugins/cal.rb | |
parent | 21949774b91eaec6ecde4eaa8ad121e2c0a36b87 (diff) |
move rbot into lib - still rearranging for packaging/installation
Diffstat (limited to 'lib/rbot/plugins/cal.rb')
-rw-r--r-- | lib/rbot/plugins/cal.rb | 15 |
1 files changed, 15 insertions, 0 deletions
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' |