After a won/lose in the bet, show which decision the bot made when he placed the bet. #95

This commit is contained in:
Alessandro Maggio
2021-03-09 14:31:12 +01:00
parent a78d3911cc
commit e310ac141d
3 changed files with 26 additions and 12 deletions

View File

@@ -324,8 +324,19 @@ class WebSocketsPool:
else "Gained"
)
)
ws.events_predictions[
event_id
].result = f"{result_type}, {action}: {points_prefix}{_millify(points_gained)}"
decision = ws.events_predictions[
event_id
].bet.get_decision()
choice = ws.events_predictions[event_id].bet.decision[
"choice"
]
logger.info(
f"{ws.events_predictions[event_id]} - Result: {result_type}, {action}: {points_prefix}{_millify(points_gained)}",
f"{ws.events_predictions[event_id]} - Decision: {choice}: {decision['title']} ({decision['color']}) - Result: {ws.events_predictions[event_id].result}",
extra={
"emoji": ":bar_chart:",
"color": Settings.logger.color_palette.get(
@@ -333,11 +344,7 @@ class WebSocketsPool:
),
},
)
ws.events_predictions[event_id].final_result = {
"type": event_result["type"],
"points_won": points_won,
"gained": points_gained,
}
ws.streamers[streamer_index].update_history(
"PREDICTION", points_gained
)