How can I dm a specific User by using Discord.py?
I'm making a discord bot with discord.py and I want to a specific user when a user uses a specific command.
from discord import DMChannel
client = discord.Client()
client = commands.Bot(command_prefix=']')
@client.command(name='dmsend', pass_context=True)
async def dmsend(ctx, user_id):
user = await client.fetch_user("71123221123")
await DMChannel.send(user, "Put the message here")
When I give the command ]dmsend nothing happens. And I've tried dmsend also. But nothing happened.