@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)
我希望我的代码能够获取频道并将所有嵌入内容发送到那里,但它甚至无法正常工作...:c
答案 0 :(得分:0)
尝试使用 discord.utils.get
...
channel = discord.utils.get(ctx.guild.channels, name="channel_name")
...
文档:https://discordpy.readthedocs.io/en/latest/api.html#discord.utils.get