Bläddra i källkod

moved bit of code in right place to avoid spamming log with errors.

tags/v2.1.1^2
Roxie Gibson 5 år sedan
förälder
incheckning
2fa93e84de
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. +1
    -1
      roxbot/cogs/trivia.py

+ 1
- 1
roxbot/cogs/trivia.py Visa fil



channel = reaction.message.channel channel = reaction.message.channel
message = reaction.message message = reaction.message
user_in_game = bool(user.id in self.games[channel.id]["players"])
try: try:
reaction_is_on_question = bool(message.id == self.games[channel.id]["current_question"].id) reaction_is_on_question = bool(message.id == self.games[channel.id]["current_question"].id)
except AttributeError: except AttributeError:
reaction_is_on_question = None reaction_is_on_question = None


if channel.id in self.games: if channel.id in self.games:
user_in_game = bool(user.id in self.games[channel.id]["players"])
if user_in_game and reaction_is_on_question: if user_in_game and reaction_is_on_question:
if reaction.emoji in self.emojis and user.id not in self.games[channel.id]["players_answered"]: if reaction.emoji in self.emojis and user.id not in self.games[channel.id]["players_answered"]:
self.games[channel.id]["players_answered"].append(user.id) self.games[channel.id]["players_answered"].append(user.id)

Laddar…
Avbryt
Spara