我需要发送嵌入式消息的帮助

时间:2019-11-08 05:18:01

标签: python discord discord.py

我正在尝试使用discord.py制作一个不和谐的机器人,该机器人使用嵌入式消息回复!help。我在其他地方看到过此问题的答案,但是每当我运行此代码时,python都会崩溃。我已经使用打印和注释来确定问题所在的行是发送消息的底部。有提示吗?

        if message.content == ('{}help'.format(prefix)):
            embed = discord.Embed(title="Title", description="Desc", color=0x00ff00)
            embed.add_field(name="Field1", value="hi", inline=True)
            embed.add_field(name="Field2", value="hi2", inline=True)
            print(embed)
            await message.channel.send(embed=embed)

1 个答案:

答案 0 :(得分:0)

您是否成功让漫游器发送了其他消息?当我在测试机器人中运行您的代码时,它就可以正常工作。也许您的机器人在当前频道中没有消息发送权限?

Example bot response