获取我的机器人在python中发送的消息的消息ID

时间:2021-01-15 15:45:08

标签: python discord discord.py

我想知道如何获取不和谐机器人发送的消息的消息 ID,而不是已发送的消息。

1 个答案:

答案 0 :(得分:1)

Messageable.send 返回一个 discord.Message 实例,然后您可以简单地使用 id 属性

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

参考: