Discord.py 如何获取BOT发送消息的id?

Discord.py How to get the id of a sent message with the BOT?

如何获取使用 BOT 发送的消息的 ID?我正在使用类似的东西:

await ctx.send("Test")

但后来我不知道如何获取该 ID。 API 参考资料中没有写明如何实现。

你可以这样做:

message = await ctx.send("Test")

获取您发送的消息。 如果您随后想要获取该消息的 id,您可以执行以下操作:

message = await ctx.send("Test")
message_id = message.id