1@client.command(pass_context=True)
2async def dm(ctx):
3 user=await client.get_user_info("User's ID here")
4 await client.send_message(user, "Your message goes here")
5 # This works ^
1import discord
2
3client = discord.Client()
4
5@client.event
6async def on_ready():
7 print('We have logged in as {0.user}'.format(client))
8
9@client.event
10async def on_message(message):
11 if message.author == client.user:
12 return
13
14 if message.content.startswith('$hello'):
15 await message.channel.send('Hello!')
16
17client.run('your token here')