diff options
-rw-r--r-- | data/rbot/plugins/games/quiz.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/data/rbot/plugins/games/quiz.rb b/data/rbot/plugins/games/quiz.rb index f16d057f..b139c66a 100644 --- a/data/rbot/plugins/games/quiz.rb +++ b/data/rbot/plugins/games/quiz.rb @@ -175,6 +175,22 @@ class QuizPlugin < Plugin @ask_mutex = Mutex.new end + def cleanup + @ask_mutex.synchronize do + # purge all waiting timers + @waiting.each do |chan, t| + @bot.timer.remove t.first + @bot.say chan, _("stopped quiz timer") + end + @waiting.clear + end + chans = @quizzes.keys + @quizzes.clear + chans.each do |chan| + @bot.say chan, _("quiz stopped") + end + end + # Function that returns whether a char is a "separator", used for hints # def is_sep( ch ) |