mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 09:26:10 +00:00
Examples now use Python 3.5. Remove echo.py example.
This commit is contained in:
@ -2,18 +2,18 @@ import discord
|
||||
|
||||
client = discord.Client()
|
||||
|
||||
@client.async_event
|
||||
def on_message(message):
|
||||
@client.event
|
||||
async def on_message(message):
|
||||
# we do not want the bot to reply to itself
|
||||
if message.author == client.user:
|
||||
return
|
||||
|
||||
if message.content.startswith('!hello'):
|
||||
msg = 'Hello {0.author.mention}'.format(message)
|
||||
yield from client.send_message(message.channel, msg)
|
||||
await client.send_message(message.channel, msg)
|
||||
|
||||
@client.async_event
|
||||
def on_ready():
|
||||
@client.event
|
||||
async def on_ready():
|
||||
print('Logged in as')
|
||||
print(client.user.name)
|
||||
print(client.user.id)
|
||||
|
Reference in New Issue
Block a user