How to get the ID of a mentioned User in Python discord bot?
问题 So I was programming a discord bot in python. But there is a problem. I know how to mention the user who sent the message. But how do I get the ID of a user that is mentioned by the author in the message? I couldn't get the answer. 回答1: You can get the user(s) that were mentioned in a message using message.mentions (async rewrite) 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 回答2: