From 7fbd614909dd47462b979770bdfd3a176c4ae350 Mon Sep 17 00:00:00 2001 From: panicbit Date: Thu, 11 Oct 2018 01:18:08 +0200 Subject: [PATCH] Show new coin total after flipping a coin --- modules/coins.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/coins.py b/modules/coins.py index 1601d2d4..3a7033eb 100644 --- a/modules/coins.py +++ b/modules/coins.py @@ -168,14 +168,16 @@ class Module(object): if win: event["user"].set_setting("coins", str(user_coins+coin_bet)) - event["stdout"].write("%s flips %s and wins %s coin%s!" % ( + event["stdout"].write("%s flips %s and wins %s coin%s! (new total: %s)" % ( event["user"].nickname, side_name, coin_bet_str, - "" if coin_bet == 1 else "s")) + "" if coin_bet == 1 else "s", + user_coins+coin_bet)) else: event["user"].set_setting("coins", str(user_coins-coin_bet)) - event["stdout"].write("%s flips %s and loses %s coin%s!" % ( + event["stdout"].write("%s flips %s and loses %s coin%s! (new total: %s)" % ( event["user"].nickname, side_name, coin_bet_str, - "" if coin_bet == 1 else "s")) + "" if coin_bet == 1 else "s", + user_coins-coin_bet)) @utils.hook("received.command.sendcoins", min_args=2, authenticated=True) def send(self, event):