1@client.event # Tells Discord that it's a event
2async def on_ready(): # Important that the
3 # name of the event is
4 # "on_ready"
5 print("Ready!") # Prints ready to the console
6
1import discord
2
3client = discord.Client()
4
5@client.event
6async def on_ready():
7 print('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')
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')