Features API

RFC1459

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

Basic RFC1459 client.

away(message)[source]

Mark self as away.

back()[source]

Mark self as not away.

ban(channel, target, range=0)[source]

Ban user from channel. Target can be either a user or a host. This command will not kick: use kickban() for that. range indicates the IP/host range to ban: 0 means ban only the IP/host, 1+ means ban that many ‘degrees’ (up to 3 for IP addresses) of the host for range bans.

connect(hostname=None, port=None, password=None, **kwargs)[source]

Connect to IRC server.

cycle(channel)[source]

Rejoin channel.

is_channel(chan)[source]

Check if given argument is a channel name or not.

is_same_channel(left, right)[source]

Check if given nicknames are equal in the server’s case mapping.

is_same_nick(left, right)[source]

Check if given nicknames are equal in the server’s case mapping.

join(channel, password=None)[source]

Join channel, optionally with password.

kick(channel, target, reason=None)[source]

Kick user from channel.

kickban(channel, target, reason=None, range=0)[source]

Kick and ban user from channel.

message(target, message)[source]

Message channel or user.

notice(target, message)[source]

Notice channel or user.

on_channel_message(target, by, message)[source]

Callback received when the client received a message in a channel.

on_channel_notice(target, by, message)[source]

Callback called when the client received a notice in a channel.

on_connect()[source]

Callback called when the client has connected successfully.

on_invite(channel, by)[source]

Callback called when the client was invited into a channel by someone.

on_join(channel, user)[source]

Callback called when a user, possibly the client, has joined the channel.

on_kick(channel, target, by, reason=None)[source]

Callback called when a user, possibly the client, was kicked from a channel.

on_kill(target, by, reason)[source]

Callback called when a user, possibly the client, was killed from the server.

on_message(target, by, message)[source]

Callback called when the client received a message.

on_mode_change(channel, modes, by)[source]

Callback called when the mode on a channel was changed.

on_nick_change(old, new)[source]

Callback called when a user, possibly the client, changed their nickname.

on_notice(target, by, message)[source]

Callback called when the client received a notice.

on_part(channel, user, message=None)[source]

Callback called when a user, possibly the client, left a channel.

on_private_message(target, by, message)[source]

Callback called when the client received a message in private.

on_private_notice(target, by, message)[source]

Callback called when the client received a notice in private.

on_quit(user, message=None)[source]

Callback called when a user, possibly the client, left the network.

on_topic_change(channel, message, by)[source]

Callback called when the topic for a channel was changed.

on_user_invite(target, channel, by)[source]

Callback called when another user was invited into a channel by someone.

on_user_mode_change(modes)[source]

Callback called when a user mode change occurred for the client.

part(channel, message=None)[source]

Leave channel, optionally with message.

quit(message=None)[source]

Quit network.

set_mode(target, *modes)[source]

Set mode on target. Users should only rely on the mode actually being changed when receiving an on_{channel,user}_mode_change callback.

set_nickname(nickname)[source]

Set nickname to given nickname. Users should only rely on the nickname actually being changed when receiving an on_nick_change callback.

set_topic(channel, topic)[source]

Set topic on channel. Users should only rely on the topic actually being changed when receiving an on_topic_change callback.

unban(channel, target, range=0)[source]

Unban user from channel. Target can be either a user or a host. See ban documentation for the range parameter.

whois(nickname)[source]

Return information about user. This is an blocking asynchronous method: it has to be called from a coroutine, as follows:

info = await self.whois(‘Nick’)
whowas(nickname)[source]

Return information about offline user. This is an blocking asynchronous method: it has to be called from a coroutine, as follows:

info = await self.whowas(‘Nick’)

Transport Layer Security

class pydle.features.TLSSupport(*args, tls_client_cert=None, tls_client_cert_key=None, tls_client_cert_password=None, **kwargs)[source]

TLS support.

Pass tls_client_cert, tls_client_cert_key and optionally tls_client_cert_password to have pydle send a client certificate upon TLS connections.

connect(hostname=None, port=None, tls=False, **kwargs)[source]

Connect to a server, optionally over TLS. See pydle.features.RFC1459Support.connect for misc parameters.

whois(nickname)[source]

Return information about user. This is an blocking asynchronous method: it has to be called from a coroutine, as follows:

info = await self.whois(‘Nick’)

Client-to-Client Protocol

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

Support for CTCP messages.

ctcp(target, query, contents=None)[source]

Send a CTCP request to a target.

ctcp_reply(target, query, response)[source]

Send a CTCP reply to a target.

on_ctcp(by, target, what, contents)[source]

Callback called when the user received a CTCP message. Client subclasses can override on_ctcp_<type> to be called when receiving a message of that specific CTCP type, in addition to this callback.

on_ctcp_reply(by, target, what, response)[source]

Callback called when the user received a CTCP response. Client subclasses can override on_ctcp_<type>_reply to be called when receiving a reply of that specific CTCP type, in addition to this callback.


Account

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

Return information about user. This is an blocking asynchronous method: it has to be called from a coroutine, as follows:

info = await self.whois(‘Nick’)

ISUPPORT

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

ISUPPORT support.


Extended WHO

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