Commit bbcd5b22 authored by Jonathan Harker's avatar Jonathan Harker

Basic hint support, for questions that have them.

parent bf2da99c
......@@ -211,10 +211,18 @@ class LolBot(SingleServerIRCBot):
def quiz_get_next(self):
self.quiz += 1
self.tip = 0
self.question = random.choice(self.qb)
print(str(self.question.question))
self.connection.notice(self.channel, "Question %s: %s" % (self.quiz, str(self.question.question)))
def quiz_tip(self):
if len(self.question.tip) > self.tip:
self.connection.notice(self.channel, "Tip: %s" % self.question.tip[self.tip])
self.tip += 1
else:
self.connection.notice(self.channel, "No more tips.")
def quiz_award_points(self, nick):
if nick not in self.quiz_scores.keys():
self.quiz_scores[nick] = 0
......@@ -300,6 +308,10 @@ class LolBot(SingleServerIRCBot):
if self.quiz:
self.quiz_scoreboard()
elif cmd == 'tip' or cmd == 'hint':
if self.quiz:
self.quiz_tip()
elif cmd == 'ask':
if self.quiz:
c.notice(self.channel, "Quiz is running. Use halt or quit to stop.")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment