-1
def check2(msg):
    return msg.author == ctx.author and msg.channel == ctx.channel

msg = await client.wait_for("message", check=check2, timeout=30)
member = ???
await member.send("test")

When it asks for a user input, I say, for example, @Bob. How do I make it DM @Bob given that I mentioned them?

realbob988
  • 13
  • 5
  • [This](https://stackoverflow.com/questions/57340919/discord-py-how-do-i-send-a-dm-to-anyone-i-want-through-a-command?rq=1) looks like exactly what you need. – Roopesh-J Nov 24 '21 at 13:59

1 Answers1

0

you can use the attribute mentions which will give you a list of users the message mentions

for ex if u want to mention multiple users:-

msg = await client.wait_for("message", check=check2, timeout=30)
mentions = msg.mentions
for users in mentions:
    await user.send("test")

or else if you just wanna send one user then:-

msg = await client.wait_for("message", check=check2, timeout=30)
mentions = msg.mentions
user = msg.mentions[0]
await user.send("test")
POINT ONE
  • 33
  • 1
  • 7