Closed ghost closed 2 years ago
This is a usage error.
pydle.Client.connect
schedules pydle.Client.handle_forever
for execution via asyncio.create_task
.
calling it a second time results in the above exception.
see https://github.com/Shizmob/pydle/blob/c0c0d619c1ae29f2a5e205252dd5efbc504468b8/pydle/client.py#L130
import pydle
import asyncio
class Me(pydle.Client):
async def on_connect(self):
await super().on_connect()
await self.join("#home")
async def main():
client = client = Me("justme")
await client.connect('localhost', tls=True, tls_verify=False)
if __name__ == "__main__":
loop.run_until_complete(main())
loop.run_forever()
I've just started tinkering with pydle, and I encountered this error when attempting to connect to my local IRC server and join a channel without a topic.
I think the error occurred because there is no
on_raw_331
function to handle the 331 response (RPL_NOTOPIC). Also, I'm not very good with asyncio, and I don't really understand the mentions of it in the error. Would this be the expected handling of an error, or have I made some mistake with asyncio in my initial setup?Setup
Error
Environment
IRC Server
Local