summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/games/quiz.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/data/rbot/plugins/games/quiz.rb b/data/rbot/plugins/games/quiz.rb
index d2e4ab97..e1e544f4 100644
--- a/data/rbot/plugins/games/quiz.rb
+++ b/data/rbot/plugins/games/quiz.rb
@@ -735,6 +735,8 @@ class QuizPlugin < Plugin
return
end
+ params[:enable] ||= 'status'
+
case params[:enable].downcase
when "on", "true"
q.registry_conf["autoask"] = true
@@ -743,8 +745,13 @@ class QuizPlugin < Plugin
when "off", "false"
q.registry_conf["autoask"] = false
m.reply "Disabled autoask mode."
+ when "status"
+ m.reply _("Autoask is %{status}, the delay is %{time}") % {
+ :status => q.registry_conf["autoask"],
+ :time => Utils.secs_to_string(q.registry_conf["autoask_delay"]),
+ }
else
- m.reply "Invalid autoask parameter. Use 'on' or 'off'."
+ m.reply "Invalid autoask parameter. Use 'on' or 'off' to set it, 'status' to check the current status."
end
end
@@ -761,7 +768,6 @@ class QuizPlugin < Plugin
m.reply "Autoask delay now #{q.registry_conf['autoask_delay']} seconds"
end
-
def cmd_transfer( m, params )
chan = m.channel
q = create_quiz( chan )
@@ -967,7 +973,7 @@ plugin.map 'quiz stats', :action => 'cmd_stats'
plugin.map 'quiz stop', :action => :stop
# Admin commands
-plugin.map 'quiz autoask :enable', :action => 'cmd_autoask', :auth_path => 'edit'
+plugin.map 'quiz autoask [:enable]', :action => 'cmd_autoask', :auth_path => 'edit'
plugin.map 'quiz autoask delay :time', :action => 'cmd_autoask_delay', :auth_path => 'edit', :requirements => {:time => /\d+/}
plugin.map 'quiz transfer :source :dest :score :jokers', :action => 'cmd_transfer', :auth_path => 'edit', :defaults => {:score => '-1', :jokers => '-1'}
plugin.map 'quiz deleteplayer :nick', :action => 'cmd_del_player', :auth_path => 'edit'