removed debug
This commit is contained in:
parent
28389931df
commit
d66160b27d
@ -33,40 +33,32 @@ class SacrificeCog(commands.Cog):
|
||||
@commands.Cog.listener()
|
||||
async def on_raw_reaction_add(self, payload):
|
||||
tracked = await self.config.tracked_msgs()
|
||||
print(str(payload.message_id))
|
||||
print(tracked.keys())
|
||||
await self.log(str(payload.message_id))
|
||||
await self.log(tracked.keys())
|
||||
if str(payload.message_id) in tracked.keys():
|
||||
# fetch channel
|
||||
channel = await self.bot.fetch_channel(620879085739966464) # channel
|
||||
if not channel:
|
||||
print("not channel")
|
||||
tracked.remove(payload.message_id)
|
||||
await self.config.tracked_msgs.set(tracked)
|
||||
return
|
||||
# fetch msg
|
||||
orig_msg = await channel.fetch_message(payload.message_id)
|
||||
if not orig_msg:
|
||||
print("not msg")
|
||||
tracked.remove(payload.message_id)
|
||||
await self.config.tracked_msgs.set(tracked)
|
||||
return
|
||||
opponents = orig_msg.mentions
|
||||
if not opponents:
|
||||
print("not opponent")
|
||||
tracked.remove(payload.message_id)
|
||||
await self.config.tracked_msgs.set(tracked)
|
||||
return
|
||||
|
||||
opponent = opponents[0]
|
||||
|
||||
print("not yet")
|
||||
print(str(payload.user_id))
|
||||
print(str(opponent.id))
|
||||
print(payload.emoji)
|
||||
if str(payload.user_id) == str(opponent.id) and payload.emoji.name == "👍":
|
||||
print("true")
|
||||
await self.log("true")
|
||||
outcome = orig_msg.content.split(" ")[2]
|
||||
print(outcome) # DEBUG
|
||||
if SacrificeCog.is_valid_winloss(outcome):
|
||||
for c in outcome:
|
||||
if c.lower() == "w":
|
||||
@ -86,10 +78,6 @@ class SacrificeCog(commands.Cog):
|
||||
del tracked[str(payload.message_id)]
|
||||
await self.config.tracked_msgs.set(tracked)
|
||||
return
|
||||
else:
|
||||
print("not valid winloss: %s" % outcome)
|
||||
else:
|
||||
print("not tracked")
|
||||
|
||||
async def track_msg(self, orig_message_id: str, bot_msg_id: str):
|
||||
tracked = await self.config.tracked_msgs()
|
||||
@ -140,7 +128,6 @@ class SacrificeCog(commands.Cog):
|
||||
k_winner = 40 # TODO: should be lowered after many games
|
||||
k_looser = 40 # TODO: should be lowered after many games
|
||||
new_elo_winner = elo_winner + k_winner * (1 - expection_winner)
|
||||
print("%s = %s + %s * (1 - %s)" % (new_elo_winner, elo_winner, k_winner, expection_winner))
|
||||
new_elo_looser = elo_looser + k_looser * (0 - expection_looser)
|
||||
await self.save_elo({winner_id: new_elo_winner, looser_id: new_elo_looser})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user