Client API

class pydle.Client

pydle.Client implements the featureset of pydle.BasicClient with all the features in the pydle.features namespace added. For the full reference, check the pydle.BasicClient documentation and the Feature API reference.

class pydle.MinimalClient

pydle.MinimalClient implements the featureset of pydle.BasicClient with some vital features in the pydle.features namespace added, namely:

For the full reference, check the pydle.BasicClient documentation and the Feature API reference.


class pydle.ClientPool(clients=None, eventloop=None)[source]

A pool of clients that are ran and handled in parallel.

connect(client: pydle.client.BasicClient, *args, **kwargs)[source]

Add client to pool.

disconnect(client)[source]

Remove client from pool.

handle_forever()[source]

Main loop of the pool: handle clients forever, until the event loop is stopped.


pydle.featurize(*features)[source]

Put features into proper MRO order.

class pydle.BasicClient(nickname, fallback_nicknames=[], username=None, realname=None, eventloop=None, **kwargs)[source]

Base IRC client class. This class on its own is not complete: in order to be able to run properly, _has_message, _parse_message and _create_message have to be overloaded.

users

A dict mapping a username to a dict with general information about that user. Available keys in the information dict:

  • nickname: The user’s nickname.
  • username: The user’s reported username on their source device.
  • realname: The user’s reported real name (GECOS).
  • hostname: The hostname where the user is connecting from.

channels

A dict mapping a joined channel name to a dict with information about that channel. Available keys in the information dict:

  • users: A set of all users currently in the channel.
connect(hostname=None, port=None, reconnect=False, **kwargs)[source]

Connect to IRC server.

connected

Whether or not we are connected.

disconnect(expected=True)[source]

Disconnect from server.

handle_forever()[source]

Handle data forever.

in_channel(channel)[source]

Check if we are currently in the given channel.

is_channel(chan)[source]

Check if given argument is a channel name or not.

is_same_channel(left, right)[source]

Check if given channel names are equal.

is_same_nick(left, right)[source]

Check if given nicknames are equal.

on_connect()[source]

Callback called when the client has connected successfully.

on_raw(message)[source]

Handle a single message.

on_unknown(message)[source]

Unknown command.

raw(message)[source]

Send raw command.

rawmsg(command, *args, **kwargs)[source]

Send raw message.

run(*args, **kwargs)[source]

Connect and run bot in event loop.