且构网

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

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

更新时间:2022-03-15 23:29:10

您可以使用 message.mentions 获取消息中提到的用户。 / code>(异步 重写

从那里,您可以从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