IRC

IRC Transport

IRC transport.

class vumi.transports.irc.irc.IrcConfig(config_data, static=False)

Bases: vumi.transports.base.TransportConfig

IRC transport config.

Configuration options:

Parameters:
  • amqp_prefetch_count (int) – The number of messages fetched concurrently from each AMQP queue by each worker instance.
  • transport_name (str) – The name this transport instance will use to create its queues.
  • publish_status (bool) – Whether status messages should be published by the transport
  • twisted_endpoint (twisted_endpoint) – Endpoint to connect to the IRC server on.
  • nickname (str) – IRC nickname for the transport IRC client to use.
  • channels (list) – List of channels to join.
  • network (str) – DEPRECATED ‘network’ and ‘port’ fields may be used in place of the ‘twisted_endpoint’ field.
  • port (int) – DEPRECATED ‘network’ and ‘port’ fields may be used in place of the ‘twisted_endpoint’ field.
class vumi.transports.irc.irc.IrcMessage(sender, command, recipient, content, nickname=None)

Bases: object

Container for details of a message to or from an IRC user.

Parameters:
  • sender (str) – Who sent the message (usually user!ident@hostmask).
  • recipient (str) – User or channel recieving the message.
  • content (str) – Contents of message.
  • nickname (str) – Nickname used by the client that received the message. Optional.
  • command (str) – IRC command that produced the message.
static canonicalize_recipient(recipient)

Convert a generic IRC address (with possible server parts) to a simple lowercase username or channel.

channel()

Return the channel if the recipient is a channel.

Otherwise return None.

class vumi.transports.irc.irc.IrcTransport(options, config=None)

Bases: vumi.transports.base.Transport

IRC based transport.

CONFIG_CLASS

alias of IrcConfig

class vumi.transports.irc.irc.VumiBotFactory(vumibot_args)

Bases: twisted.internet.protocol.ClientFactory

A factory for VumiBotClient instances.

A new protocol instance will be created each time we connect to the server.

protocol

alias of VumiBotProtocol

class vumi.transports.irc.irc.VumiBotProtocol(nickname, channels, irc_transport)

Bases: twisted.words.protocols.irc.IRCClient

An IRC bot that bridges IRC to Vumi.

action(sender, recipient, message)

This will get called when the bot sees someone do an action.

alterCollidedNick(nickname)

Generate an altered version of a nickname that caused a collision in an effort to create an unused related name for subsequent registration.

irc_NICK(prefix, params)

Called when an IRC user changes their nickname.

joined(channel)

This will get called when the bot joins the channel.

noticed(sender, recipient, message)

This will get called when the bot receives a notice.

privmsg(sender, recipient, message)

This will get called when the bot receives a message.

signedOn()

Called when bot has succesfully signed on to server.