问题
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