Remove stink str() conversions.
This commit is contained in:
parent
b77ef20fed
commit
75b9a01928
1 changed files with 5 additions and 5 deletions
10
lolbot.py
10
lolbot.py
|
|
@ -213,8 +213,8 @@ class LolBot(SingleServerIRCBot):
|
||||||
self.quiz += 1
|
self.quiz += 1
|
||||||
self.tip = 0
|
self.tip = 0
|
||||||
self.question = random.choice(self.qb)
|
self.question = random.choice(self.qb)
|
||||||
print(str(self.question.question))
|
print(self.question.question)
|
||||||
self.connection.notice(self.channel, "Question %s: %s" % (self.quiz, str(self.question.question)))
|
self.connection.notice(self.channel, "Question %s: %s" % (self.quiz, self.question.question))
|
||||||
|
|
||||||
def quiz_tip(self):
|
def quiz_tip(self):
|
||||||
if len(self.question.tip) > self.tip:
|
if len(self.question.tip) > self.tip:
|
||||||
|
|
@ -315,10 +315,10 @@ class LolBot(SingleServerIRCBot):
|
||||||
elif cmd == 'ask':
|
elif cmd == 'ask':
|
||||||
if self.quiz:
|
if self.quiz:
|
||||||
c.notice(self.channel, "Quiz is running. Use halt or quit to stop.")
|
c.notice(self.channel, "Quiz is running. Use halt or quit to stop.")
|
||||||
c.notice(self.channel, str(self.question.question))
|
c.notice(self.channel, self.question.question)
|
||||||
elif isinstance(self.question, Question):
|
elif isinstance(self.question, Question):
|
||||||
c.notice(self.channel, "There is an unanswered question.")
|
c.notice(self.channel, "There is an unanswered question.")
|
||||||
c.notice(self.channel, str(self.question.question))
|
c.notice(self.channel, self.question.question)
|
||||||
else:
|
else:
|
||||||
self.start_quiz(nick)
|
self.start_quiz(nick)
|
||||||
|
|
||||||
|
|
@ -408,7 +408,7 @@ class LolBot(SingleServerIRCBot):
|
||||||
try:
|
try:
|
||||||
(options, args) = getopt.getopt(sys.argv[1:], 'hc:s:p:j:n:d:', ['help', 'config=', 'server=', 'port=', 'join=', 'nick=', 'database=', ])
|
(options, args) = getopt.getopt(sys.argv[1:], 'hc:s:p:j:n:d:', ['help', 'config=', 'server=', 'port=', 'join=', 'nick=', 'database=', ])
|
||||||
except getopt.GetoptError as err:
|
except getopt.GetoptError as err:
|
||||||
print(str(err))
|
print(err)
|
||||||
LolBot.usage()
|
LolBot.usage()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue