且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Python discord bot 中获取提到的用户的 ID?

更新时间:2022-02-28 22:41:58

您可以使用 message.mentions (异步 重写)

从那里,您可以从 Member 对象中获取 ID,或者从这些对象中获取格式化的提及

From there, you can either get the ID from the Member object, or get a formatted mention from those objects

message.mentions[0].id
message.mentions[0].mention