X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fcal.rb;h=9190f8e9dbbefb8f10149fa11c0e8c254c8bbf72;hb=c31697b2d75aa46df9163ebce92ee68fd0f9ce7f;hp=dd1d1538a143826f4e010501655ba027a17f91e8;hpb=8caeee3853ef66dd0e326ff17906f9ca544b8a35;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/cal.rb b/data/rbot/plugins/cal.rb index dd1d1538..9190f8e9 100644 --- a/data/rbot/plugins/cal.rb +++ b/data/rbot/plugins/cal.rb @@ -1,12 +1,21 @@ class CalPlugin < Plugin + Config.register Config::StringValue.new('cal.path', + :default => 'cal', + :desc => _('Path to the cal program')) + def help(plugin, topic="") "cal [month year] => show current calendar [optionally specify month and year]" end + + def cal_path + @bot.config["cal.path"] + end + def cal(m, params) if params.has_key?(:month) - m.reply Utils.safe_exec("cal", params[:month], params[:year]) + m.reply Utils.safe_exec(cal_path, params[:month], params[:year]) else - m.reply Utils.safe_exec("cal") + m.reply Utils.safe_exec(cal_path) end end end