Python 嵌入21点命令Discord.py

Python 嵌入21点命令Discord.py,python,discord,discord.py,embed,Python,Discord,Discord.py,Embed,我曾试图嵌入这段代码,但就我的一生而言,我无法理解它。我想我已经做了一切尝试,但我是一个初学者程序员!谁能为我嵌入这个代码,这将是非常有帮助的 if message.content == '!blackjack': global playing playing = True global deck deck = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] * 4

我曾试图嵌入这段代码,但就我的一生而言,我无法理解它。我想我已经做了一切尝试,但我是一个初学者程序员!谁能为我嵌入这个代码,这将是非常有帮助的

    if message.content == '!blackjack':
       
        global playing
        playing = True
        global deck
        deck = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] * 4
        global player_hand
        player_hand = deal(deck)
        global dealer_hand
        dealer_hand = deal(deck)
        global msg
        msg = await message.channel.send(f'Player has:  {player_hand}, Dealer has: [{dealer_hand[0]}, *]')
        await message.channel.send('Hit or Stand?')
    if message.content == 'hit' and playing == True:
        draw(deck, player_hand)
        await message.channel.send(f'Player has:  {player_hand}, Dealer has: [{dealer_hand[0]}, *]')
        if total(player_hand) > 21:
            await message.channel.send('Player busted!')
            playing = False
    if message.content == 'stand' and playing == True:
        while total(dealer_hand) < 17:
            draw(deck, dealer_hand)
            await message.channel.send('Dealer hits')
            if total(dealer_hand) > 21:
                await message.channel.send(f'Dealer busted: {dealer_hand}, Player wins!')
                playing = False
                return
        await message.channel.send(f'Player has: {player_hand} ({total(player_hand)}), Dealer has {dealer_hand} ({total(dealer_hand)})')
        if total(dealer_hand) > total(player_hand) and total(dealer_hand) <= 21:
            await message.channel.send(f'Dealer wins!')
            playing = False
        elif total(dealer_hand) == total(player_hand) and total(dealer_hand) <= 21:
            await message.channel.send(f'Tie!')
        else:
            await message.channel.send(f'Player wins!')
            playing = False```
如果message.content==”!21点:
全球比赛
玩=真
全球甲板
甲板=[2,3,4,5,6,7,8,9,10,11,12,13,14]*4
全球玩家之手
玩家手牌=交易(牌组)
全球经销商
经销商手牌=交易(牌组)
全球味精
msg=wait message.channel.send(f'Player has:{Player_hand},庄家has:[{庄家_hand[0]},*]))
等待消息.channel.send('Hit or Stand?'))
如果message.content='hit'和playing==True:
抽签(牌组、玩家手)
wait message.channel.send(f'Player has:{Player_hand},庄家has:[{Player_hand[0]},*]))
如果总数(玩家手牌)>21:
等待消息.channel.send('Player busted!')
播放=错误
如果message.content='stand'和playing==True:
当总数(经销商手)小于17时:
牵引(甲板、经销商手)
等待消息。频道。发送('经销商点击')
如果总数(经销商手)大于21:
等待消息。频道。发送(f'Dealer busted:{Dealer_hand},玩家获胜!)
播放=错误
返回
等待消息.channel.send(f'Player has:{Player_hand}({total(Player_hand)}),庄家has{Dealer_hand}({total(Dealer_hand)})'))

如果total(庄家手牌)>total(玩家手牌)和total(庄家手牌),您是否尝试过使用打印状态?请告诉我们哪里出了问题。错误是什么。欢迎使用StackOverflow!请阅读并提出一个好问题,该问题将在此处得到正确回答。因此,这不是一个为我编写代码的网站,请不要期望我们为您完成工作。以下是一个有用的链接,您可以从中了解如何嵌入代码: