I am trying to have it send a dm to a specified user using the on_message event. So far I've gotten it to get the snowflake id from the mentioned user but can't find a way to send a dm to that user. I've been looking for hours and haven't found an anwser please help.
Asked
Active
Viewed 143 times
-1
-
2Does this answer your question? [Python - DM a User Discord Bot](https://stackoverflow.com/questions/52343245/python-dm-a-user-discord-bot) – charlie scott May 17 '21 at 19:31
1 Answers
1
It depends on which version of discord.py you are using but assuming you are using a version newer than 1.0:
Use user.send(message)
.
To be more specific than that I'd need a code snippet or more in depth description of exactly what you are trying to do
To get a user id from a mention:
Use a converter to get the User object:
@bot.command(name="id")
async def id_(ctx, user: discord.User):
await ctx.send(user.id)
from this post: How to get ID of a mentioned user (Discord.py)

charlie scott
- 136
- 1
- 9