Discord.py:如何锁定由webhook制作的帖子?

Discord.py:如何锁定由webhook制作的帖子?,discord.py,discord.py-rewrite,Discord.py,Discord.py Rewrite,但是我从webhook.send得到一个str作为回报。如何获取消息类型以便能够锁定它? 提前谢谢。如果您阅读了。您将看到需要添加以下参数:wait=True(通过webhook发送时)。这将返回消息。如果您不这样做,它将返回文件中解释的无 因此,您需要做的是: Message= await webhook.send("Test message to pin") await Message.pin() 我建议您也看看PEP8,因为将变量资本化是违反PEP8 python标准的。 Message

但是我从webhook.send得到一个str作为回报。如何获取消息类型以便能够锁定它? 提前谢谢。

如果您阅读了。您将看到需要添加以下参数:
wait=True
(通过webhook发送时)。这将返回消息。如果您不这样做,它将返回文件中解释的无

因此,您需要做的是:

Message= await webhook.send("Test message to pin")
await Message.pin()

我建议您也看看PEP8,因为将变量资本化是违反PEP8 python标准的。
Message = await webhook.send("Test message to pin", wait=True)
await Message.pin()