Someone asked me to make a bot for him that sends a DM to anyone he specifies through a command, like *send_dm @Jess#6461 hello
.
I've searched alot and I came across this code:
async def send_dm(ctx,member:discord.Member,*,content):
await client.send_message(member,content)
but then I got the error:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'send_message'
I want to type for example : *send_dm @Jess#6461 hello
and the bot sends a DM saying "hello" to that user.