Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/359.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 未发送不协调的嵌入_Python_Discord - Fatal编程技术网

Python 未发送不协调的嵌入

Python 未发送不协调的嵌入,python,discord,Python,Discord,出于某种原因,这不起作用。我在其他的on_message if语句中也有同样的代码,它们工作得非常好我想我可以帮你 您的on_消息似乎没有被发送,因为您在创建事件时忘记添加参数(您可以有此消息,但没有显示)!而且,这种颜色不存在,所以我会再次检查你的十六进制。以下是您解决问题的方法: @bot.event 消息上的异步定义(消息):#我定义了我的消息 channel=message.channel 嵌入=不和谐。嵌入( title=f“好的{message.author.name}{messag

出于某种原因,这不起作用。我在其他的on_message if语句中也有同样的代码,它们工作得非常好

我想我可以帮你

您的on_消息似乎没有被发送,因为您在创建事件时忘记添加参数(您可以有此消息,但没有显示)!而且,这种颜色不存在,所以我会再次检查你的十六进制。以下是您解决问题的方法:

@bot.event
消息上的异步定义(消息):#我定义了我的消息
channel=message.channel
嵌入=不和谐。嵌入(
title=f“好的{message.author.name}{message.author.discriminator}”,
#我这样做只是为了在私人频道调用事件时^,
#您不会收到错误(message.author返回abc.User,如果它在专用频道中)
description=f“命令已取消。再次读取可能会得到更好的结果。\n\n或者请参阅“更新统计信息”下的{info_chan}了解其他更新选项。”,
颜色=CC79A7)#给你买了一件粉红色的吗
等待通道发送(嵌入=嵌入)

您可以在此处查看discord.py文档:

是否有任何错误?
...on_message():
channel = message.channel

embed = discord.Embed(title=f"**Ok {member_name}**", description=f"Command cancelled. You might get better results with a second read.\n\nOr please see {info_chan} under 'Updating Stats' for other update options.", color=0xcc79a7)
await channel.send(embed=embed)