Examples now use Python 3.5. Remove echo.py example.

This commit is contained in:
Rapptz
2016-01-06 11:34:49 -05:00
parent 51186c3ca4
commit 2ebfbbe471
8 changed files with 61 additions and 80 deletions

View File

@ -3,18 +3,17 @@ import asyncio
client = discord.Client()
@asyncio.coroutine
def my_background_task():
yield from client.wait_until_ready()
async def my_background_task():
await client.wait_until_ready()
counter = 0
channel = discord.Object(id='channel_id_here')
while not client.is_closed:
counter += 1
yield from client.send_message(channel, counter)
yield from asyncio.sleep(60) # task runs every 60 seconds
await client.send_message(channel, counter)
await asyncio.sleep(60) # task runs every 60 seconds
@client.async_event
def on_ready():
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)