summaryrefslogtreecommitdiff
path: root/lib/rbot/plugins/cal.rb
blob: 4f28310b60f640cd721eb0398302fb16e92eed98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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'