summaryrefslogtreecommitdiff
path: root/data/rbot
diff options
context:
space:
mode:
Diffstat (limited to 'data/rbot')
-rw-r--r--data/rbot/plugins/cal.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/data/rbot/plugins/cal.rb b/data/rbot/plugins/cal.rb
index dd1d1538..bfac39e5 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 => '/usr/bin/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