Discord.py: How to pin a post made by a webhook?

|▌冷眼眸甩不掉的悲伤 提交于 2020-03-25 12:59:53

问题


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

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.


回答1:


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()


来源:https://stackoverflow.com/questions/60608472/discord-py-how-to-pin-a-post-made-by-a-webhook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!