I’m new to discord.py (and general programming) I want to make a command which dms mentioned user with specified text. Can you please explain how to make it?
Hi @Lemon553311-dev , can you tell me what version of python and discord.py are you using?
sorry for my bad english, i’m spanish xD
I would help, but it was around 2 years ago I tried python bots. They are harder than JavaScript in my opinion.
xD maybe. I program bots in python since 2 months and i have a masterpiece.
This may help a bit.
unactualized version of discord. The version of discord used in that link is old and for example bot.get_userinfo doesn’t exist
@RiversideRocks
That sucks. Sorry, I’m not very familiar with python!
no problem, we are for help.
sorry for my bad english, i’m spanish xD
im using python 3.7.7
discord.py = 1.2.3
i have found a way to make bot say provided message but now i need to figure out how to make bot DM a specified user.
creating a dm channel in discord.py is explained here: https://discordpy.readthedocs.io/en/latest/api.html#discord.User.dm_channel
so you can simply get a message object, then use await message.author.dm_channel.send("message")
to send a message to a user via dms.
@Lemon553311-dev you can?
Instead of ctx.send("message")
its ctx.author.send("message")
(basically user.send("message")
)
this helped me out so much. hours of looking for a simple way without having to retrieve a discord.Member object to send a message. Thank you so much for your help