Sehn
Sehn

Reputation: 37

Webhook.send(<message>) discord.py doesn't return anything

Like said in the title, if I were to do something like :

webhook = await channel.create_webhook(name='test')
msg = await webhook.send(content='test', username='Useless Webhook')
print(f"{msg}\n{type(msg)}")

It returns :

None
<class 'NoneType'>

And in the discord documentation :

Returns
The message that was sent.
Return type
Optional[Message]```

Don't know how to solve that problem...

My goal here is to delete the message that was sent by the webhook after some time (like 2sec).

Upvotes: 0

Views: 950

Answers (1)

Sehn
Sehn

Reputation: 37

Well, it wasn't very difficult, I had just to add the wait parameter set to True in webhook.send()

(I thought the wait parameter may delay the message)

Upvotes: 1

Related Questions