Fix README example code.
This commit is contained in:
		| @@ -46,6 +46,7 @@ Note that this requires `git` to be installed. | ||||
|  | ||||
| ```py | ||||
| import discord | ||||
| import asyncio | ||||
|  | ||||
| client = discord.Client() | ||||
|  | ||||
| @@ -76,7 +77,11 @@ def main_task(): | ||||
|     yield from client.connect() | ||||
|  | ||||
| loop = asyncio.get_event_loop() | ||||
| try: | ||||
|     loop.run_until_complete(main_task()) | ||||
| except Exception: | ||||
|     loop.run_until_complete(client.close()) | ||||
| finally: | ||||
|     loop.close() | ||||
| ``` | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user