Discord.py:如何固定由Webhook发表的帖子? [英] Discord.py: How to pin a post made by a webhook?

查看:58
本文介绍了Discord.py:如何固定由Webhook发表的帖子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

但是我从webhook.send获得了回报。如何获取消息类型,以便将其固定?
提前谢谢。

But I get a str in return from webhook.send. How can I get a message type so I'm able to pin it? Thank you in advance.

推荐答案

如果您阅读了文档。您将看到需要添加以下参数: wait = True (通过Webhook发送时)。这将返回消息。如果您不这样做,则将按照文档中的说明返回None。

If you read the documentation. You will see that you need to add the following parameter: wait=True (when sending through a webhook). This will return the message. If you dont do this it will return None as explained in the doc.

因此,您需要执行的操作:

Thus what you need to do:

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

这篇关于Discord.py:如何固定由Webhook发表的帖子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆