-
discord.py 1.7.2 use case:
Code
I have tried the follow
how can I private message the user? Thank you |
Beta Was this translation helpful? Give feedback.
Answered by
Rapptz
May 5, 2021
Replies: 1 comment 1 reply
-
In v1.7 you need to fetch the user first: user = bot.get_user(user_id) or await bot.fetch_user(user_id)
await user.send('whatever') In the future in v2.0 (still in development) you'll be able to open a DM directly via user ID: dm = await client.create_dm(user_id)
await dm.send('whatever') |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In v1.7 you need to fetch the user first:
In the future in v2.0 (still in development) you'll be able to open a DM directly via user ID: