Vortex
Vortex

Reputation: 29

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

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.

Upvotes: 0

Views: 415

Answers (1)

Deru
Deru

Reputation: 1173

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

Upvotes: 1

Related Questions