def blackjack(self, ctx, bet: int):
"""Modified Blackjack."""
# Declare variables for the game.
user = ctx.message.author
settings = super().check_server_settings(user.server)
# Run a logic check to determine if the user can play the game
check = self.game_checks(settings, ctx.prefix, user, bet, "Blackjack", 1, [1])
if check:
msg = check
else: # Run the game when the checks return None
super().withdraw_chips(user, bet)
settings["Players"][user.id]["Played"]["Blackjack"] += 1
deck = main_deck[:] # Make a copy of the deck so we can remove cards that are drawn
dhand = self.dealer(deck)
ph, dh, amt = await self.blackjack_game(dhand, user, bet, deck)
msg = self.blackjack_results(settings, user, amt, ph, dh)
# Send a message telling the user the outcome of this command
await self.bot.say(msg)
评论列表
文章目录