+ def cmd_autoskip( m, params )
+ chan = m.channel
+ q = create_quiz( chan, m )
+ return unless q
+
+ params[:enable] ||= 'status'
+
+ reg = q.registry_conf
+
+ case params[:enable].downcase
+ when "on", "true"
+ reg["autoskip"] = true
+ m.reply "Enabled autoskip mode."
+ # default: 1 minute (TODO customize with a global config key)
+ reg["autoskip_delay"] = 60 unless reg.has_key("autoskip_delay")
+ # also set a default autoask delay
+ reg["autoask_delay"] = 0 unless reg.has_key("autoask_delay")
+ when "off", "false"
+ reg["autoskip"] = false
+ m.reply "Disabled autoskip mode."
+ when "status"
+ if reg.has_key? "autoskip"
+ m.reply _("autoskip is %{status}, the delay is %{time}") % {
+ :status => reg["autoskip"],
+ :time => Utils.secs_to_string(reg["autoskip_delay"]),
+ }
+ else
+ m.reply _("autoskip is not configured here")
+ end
+ else
+ m.reply "Invalid autoskip parameter. Use 'on' or 'off' to set it, 'status' to check the current status."
+ end
+ end
+
+ def cmd_autoskip_delay( m, params )