Skip to content

Commit 8217f56

Browse files
committed
fix: game stuck at blackjack
A few players reported that they were stuck at a blackjack. I assume this was because of the weird if/elif construct? But I don't know for sure. Either way this is at worst just a necessary refactor.
1 parent 0074e40 commit 8217f56

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

blackjackbot/commands/game/commands.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,11 @@ def hit_callback(update, context):
168168
player_cards = get_cards_string(player, lang_id)
169169
if player.has_blackjack():
170170
text = (translator("your_cards_are") + "\n\n" + translator("got_blackjack")).format(user_mention, player.cardvalue, player_cards)
171-
update.effective_message.edit_text(text=text, parse_mode=ParseMode.HTML, reply_markup=None)
172-
next_player(update, context)
173-
elif player.cardvalue == 21:
171+
else:
174172
text = (translator("your_cards_are") + "\n\n" + translator("got_21")).format(user_mention, player.cardvalue, player_cards)
175-
update.effective_message.edit_text(text=text, parse_mode=ParseMode.HTML, reply_markup=None)
176-
next_player(update, context)
173+
174+
update.effective_message.edit_text(text=text, parse_mode=ParseMode.HTML, reply_markup=None)
175+
next_player(update, context)
177176

178177

179178
@needs_active_game

0 commit comments

Comments
 (0)