shizmob / pydle

An IRCv3-compliant Python 3 IRC library.
BSD 3-Clause "New" or "Revised" License
154 stars 48 forks source link

[#151] Fixup irccat.py example #152

Closed theunkn0wn1 closed 3 years ago

theunkn0wn1 commented 3 years ago

This PR attempts to modernize the irccat example.

In multiple places there was legacy references to async abstractions that I believe have been removed. In many places there was legacy (and deprecated) async syntax which has been corrected.

The main function has been abstracted to run a async def _main to simplify the logic.

asyncio.get_event_loop().run_until_complete(_main()) was chosen over the simpler asyncio.run(_main()) syntax since this library supports 3.6, where asyncio.run wasn't introduced until Python 3.7 .

closes #151