Update session.py (#3666)

This commit is contained in:
jack1142
2020-03-19 08:17:32 +01:00
committed by GitHub
parent 3e1bb88ab7
commit 23eae27a8f

View File

@@ -303,7 +303,10 @@ class TriviaSession:
amount = int(multiplier * score)
if amount > 0:
LOG.debug("Paying trivia winner: %d credits --> %s", amount, str(winner))
await bank.deposit_credits(winner, int(multiplier * score))
try:
await bank.deposit_credits(winner, int(multiplier * score))
except bank.BalanceTooHigh as e:
await bank.set_balance(winner, e.max_balance)
await self.ctx.send(
_(
"Congratulations, {user}, you have received {num} {currency}"