shizmob / pydle

An IRCv3-compliant Python 3 IRC library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Single Client Multiple Servers?

ixxie opened this issue · comments

The documentation has an example of connecting multiple client objects to multiple servers in a single pool:

for server in servers:
    client = MyClient('MyBot')
    pool.connect(client, server, tls=True)

# Handle all clients in the pool at once.
pool.handle_forever()

I take it there is no way to connect a single client to multiple servers?

Unfortunately, at this time Pydle does not support a single client connecting to multiple IRC networks concurrently.
This is evidenced by the signature of Client.message:

    async def message(self, target, message):

Where target is a string channel, and message is a string payload.

Many of Pydle's interfaces, such as pydle.client.message() are simply not designed for use against multiple servers at the same time in the same instance of the object. Thus, it would require a rather significant change in the API to add an argument specifying /which/ server to perform the action against.


In order to maintain a presence across IRC networks, you will need to instantiate your Client class multiple times, once per IRC network you intend to connect to.

Well, that is disappointing but thanks for the clear answer. I guess this can be closed?