Tamari
Tamari

Reputation: 1

Get message ID of the message sent by my bot in python

I'm wondering how to get the message ID of a message being sent by a bot in discord, not a message that has already been sent.

Upvotes: 0

Views: 285

Answers (1)

Łukasz Kwieciński
Łukasz Kwieciński

Reputation: 15689

Messageable.send returns a discord.Message instance, then you can simply use the id attribute

message = await Messageable.send("Whatever") # This can be the context, a channel, a dm channel...
message_id = message.id

Reference:

Upvotes: 1

Related Questions