我一直在研究一个不和谐的机器人。我想知道如何使用edit_消息来更改消息的嵌入颜色。在
这是我的代码:
@bot.command()
async def test(self):
"""Embed color changing"""
em1 = discord.Embed(title="Red", colour=0xFF0000)
msg = await self.message.channel.send(embed=em1)
em2 = discord.Embed(title="Green", colour=0x00FF00)
await self.bot.edit_message(msg, embed=em2)
当我运行该命令时,出现以下错误:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'edit_message'
哪个版本的不和.py你在用吗?你的代码看起来像是为v0.16或更高版本编写的。在
在v1.0.0之后,您将使用Message.edit()
await msg.edit(embed=em2)
相关问题 更多 >
编程相关推荐