From 2ebfbbe471ce32a3cd29ee2099a3c9de77fa311c Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 6 Jan 2016 11:34:49 -0500 Subject: Examples now use Python 3.5. Remove echo.py example. --- examples/reply.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples/reply.py') diff --git a/examples/reply.py b/examples/reply.py index 2faf8a9d..b111113a 100644 --- a/examples/reply.py +++ b/examples/reply.py @@ -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) -- cgit v1.2.3