Python 我的代码不是';在给定通道中不发送任何消息,它只是不';我什么也不做

Python 我的代码不是';在给定通道中不发送任何消息,它只是不';我什么也不做,python,discord.py,Python,Discord.py,我希望我的代码获得通道并将所有嵌入发送到那里,但它甚至不工作…:c尝试使用discord.utils.get 。。。 channel=discord.utils.get(ctx.guild.channels,name=“channel\u name”) ... 文档:如果有回溯错误,请添加回溯错误(如果没有,请精确),并更具体地说明问题所在。此外,我认为有些代码丢失了,因为您有一段时间没有任何退出方式(这是非常不鼓励的)。我在我的其他函数中使用了while循环,它们工作正常,但这并不意味着我要

我希望我的代码获得通道并将所有嵌入发送到那里,但它甚至不工作…:c

尝试使用
discord.utils.get

。。。
channel=discord.utils.get(ctx.guild.channels,name=“channel\u name”)
...

文档:

如果有回溯错误,请添加回溯错误(如果没有,请精确),并更具体地说明问题所在。此外,我认为有些代码丢失了,因为您有一段时间没有任何退出方式(这是非常不鼓励的)。我在我的其他函数中使用了
while
循环,它们工作正常,但这并不意味着我要添加回溯,因为我对这一点很重要!!在\u message上\u delete()仅获取了文档()中所述的消息参数
@bot.event
async def on_message_delete(before, after):
    boolean=data['message_edit']
    while boolean:
        if before.author.id==589444599836180481:
            pass
        else:
            channel=bot.get_channel(id=1231231293891)
            embed=discord.Embed(color=before.author.color)
            embed.add_field(name='Edited', value=f'Author: {before.message.author}')
            embed.add_field(name='Before:', value=before.content + "\u200b")
            embed.add_field(name="After:", value=after.content + "\u200b")

            await channel.send(embed=embed)