diff options
| author | Rapptz <[email protected]> | 2016-01-06 11:34:49 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-01-06 11:34:49 -0500 |
| commit | 2ebfbbe471ce32a3cd29ee2099a3c9de77fa311c (patch) | |
| tree | 8a332c941434a695a4f7ca39e0e1aba8ee7f994e /examples/reply.py | |
| parent | [commands] Add CommandNotFound error. (diff) | |
| download | discord.py-2ebfbbe471ce32a3cd29ee2099a3c9de77fa311c.tar.xz discord.py-2ebfbbe471ce32a3cd29ee2099a3c9de77fa311c.zip | |
Examples now use Python 3.5. Remove echo.py example.
Diffstat (limited to 'examples/reply.py')
| -rw-r--r-- | examples/reply.py | 10 |
1 files changed, 5 insertions, 5 deletions
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() [email protected]_event -def on_message(message): +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) [email protected]_event -def on_ready(): +async def on_ready(): print('Logged in as') print(client.user.name) print(client.user.id) |