summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/cal.rb
blob: dd1d1538a143826f4e010501655ba027a17f91e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class CalPlugin < Plugin
  def help(plugin, topic="")
    "cal [month year] => show current calendar [optionally specify month and year]"
  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'