From df1c5f41964d3ebc8ab9a4b2fe6ac2e4be364041 Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Thu, 30 Jul 2020 12:52:01 +0200 Subject: [PATCH] :bug: --- Gwendolyn.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Gwendolyn.py b/Gwendolyn.py index 54e4f62..85e0dca 100644 --- a/Gwendolyn.py +++ b/Gwendolyn.py @@ -414,18 +414,19 @@ async def parseCommands(message,content): elif content.startswith("blackjack"): # Starts the game if content == "blackjack" or content == "blackjack ": + cardsLeft = 0 + with open("resources/games/blackjackCards.txt","r") as f: + for line in f: + cardsLeft += 1 + + # Shuffles if not enough cards + if cardsLeft < blackjackMinCards: + blackjackShuffle(blackjackDecks) + logThis("Shuffling the blackjack deck...",str(message.channel)) + await message.channel.send("Shuffling the deck...") + new_message = blackjackStart(str(message.channel)) if new_message == "started": - cardsLeft = 0 - with open("resources/games/blackjackCards.txt","r") as f: - for line in f: - cardsLeft += 1 - - # Shuffles if not enough cards - if cardsLeft < blackjackMinCards: - blackjackShuffle(blackjackDecks) - logThis("Shuffling the blackjack deck...",str(message.channel)) - await message.channel.send("Shuffling the deck...") new_message = "Blackjack game started. Use \""+commandPrefix+"blackjack bet [amount]\" to enter the game within the next 30 seconds." await message.channel.send(new_message)