Class t.w.p.i.IRC(protocol.Protocol):

Part of twisted.words.protocols.irc View Source View In Hierarchy

Known subclasses: twisted.words.im.proxyui.IRCUserInterface, twisted.words.service.IRCUser

Internet Relay Chat server protocol.

Split Table into Classes Show Methods in One Table

Line # Kind Name Docs
110 Method connectionMade Called when a connection is made.
116 Method sendLine Undocumented
123 Method sendMessage Send a line formatted as an IRC message.
150 Method dataReceived This hack is to support mIRC, which sends LF only,
175 Method handleCommand Determine the function to call for the given command and call
189 Method irc_unknown Implement me!
195 Method privmsg Send a message to a channel or user
212 Method notice Send a "notice" to a channel or user.
233 Method action Send an action to a channel or user.
250 Method topic Send the topic to a user.
279 Method topicAuthor Send the author of and time at which a topic was set for the given
305 Method names Send the names of a channel's participants to a user.
340 Method who Send a list of users participating in a channel.
370 Method whois Send information about the state of a particular user.
424 Method join Send a join message.
437 Method part Send a part message.
457 Method channelMode Send information about the mode of a channel.

Inherited from Protocol:

Line # Kind Name Docs
384 Method connectionLost Called when the connection is shut down.

Inherited from BaseProtocol (via Protocol):

Line # Kind Name Docs
341 Method makeConnection Make a connection to a transport and a server.
Line # Kind Name Docs
233 Method action Send an action to a channel or user.
457 Method channelMode Send information about the mode of a channel.
384 Method connectionLost Called when the connection is shut down.
110 Method connectionMade Called when a connection is made.
150 Method dataReceived This hack is to support mIRC, which sends LF only,
175 Method handleCommand Determine the function to call for the given command and call
189 Method irc_unknown Implement me!
424 Method join Send a join message.
341 Method makeConnection Make a connection to a transport and a server.
305 Method names Send the names of a channel's participants to a user.
212 Method notice Send a "notice" to a channel or user.
437 Method part Send a part message.
195 Method privmsg Send a message to a channel or user
116 Method sendLine Undocumented
123 Method sendMessage Send a line formatted as an IRC message.
250 Method topic Send the topic to a user.
279 Method topicAuthor Send the author of and time at which a topic was set for the given
340 Method who Send a list of users participating in a channel.
370 Method whois Send information about the state of a particular user.
def connectionMade(self): (source)

Called when a connection is made.

This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.
def sendLine(self, line): (source)
Undocumented
def sendMessage(self, command, *parameter_list, **prefix): (source)

Send a line formatted as an IRC message.

First argument is the command, all subsequent arguments are parameters to that command. If a prefix is desired, it may be specified with the keyword argument 'prefix'.
def dataReceived(self, data): (source)
This hack is to support mIRC, which sends LF only, even though the RFC says CRLF. (Also, the flexibility of LineReceiver to turn "line mode" on and off was not required.)
def handleCommand(self, command, prefix, params): (source)
Determine the function to call for the given command and call it with the given arguments.
def irc_unknown(self, prefix, command, params): (source)
Implement me!
def privmsg(self, sender, recip, message): (source)
Send a message to a channel or user
ParameterssenderWho is sending this message. Should be of the form username!ident@hostmask (unless you know better!). (type: str or unicode )
recipThe recipient of this message. If a channel, it must start with a channel prefix. (type: str or unicode )
messageThe message being sent. (type: str or unicode )
def notice(self, sender, recip, message): (source)

Send a "notice" to a channel or user.

Notices differ from privmsgs in that the RFC claims they are different. Robots are supposed to send notices and not respond to them. Clients typically display notices differently from privmsgs.
ParameterssenderWho is sending this message. Should be of the form username!ident@hostmask (unless you know better!). (type: str or unicode )
recipThe recipient of this message. If a channel, it must start with a channel prefix. (type: str or unicode )
messageThe message being sent. (type: str or unicode )
def action(self, sender, recip, message): (source)
Send an action to a channel or user.
ParameterssenderWho is sending this message. Should be of the form username!ident@hostmask (unless you know better!). (type: str or unicode )
recipThe recipient of this message. If a channel, it must start with a channel prefix. (type: str or unicode )
messageThe action being sent. (type: str or unicode )
def topic(self, user, channel, topic, author=None): (source)
Send the topic to a user.
ParametersuserThe user receiving the topic. Only their nick name, not the full hostmask. (type: str or unicode )
channelThe channel for which this is the topic. (type: str or unicode )
topicThe topic string, unquoted, or None if there is no topic. (type: str or unicode or None )
authorIf the topic is being changed, the full username and hostmask of the person changing it. (type: str or unicode )
def topicAuthor(self, user, channel, author, date): (source)

Send the author of and time at which a topic was set for the given channel.

This sends a 333 reply message, which is not part of the IRC RFC.
ParametersuserThe user receiving the topic. Only their nick name, not the full hostmask. (type: str or unicode )
channelThe channel for which this information is relevant. (type: str or unicode )
authorThe nickname (without hostmask) of the user who last set the topic. (type: str or unicode )
dateA POSIX timestamp (number of seconds since the epoch) at which the topic was last set. (type: int )
def names(self, user, channel, names): (source)
Send the names of a channel's participants to a user.
ParametersuserThe user receiving the name list. Only their nick name, not the full hostmask. (type: str or unicode )
channelThe channel for which this is the namelist. (type: str or unicode )
namesThe names to send. (type: list of str or unicode )
def who(self, user, channel, memberInfo): (source)
Send a list of users participating in a channel.
ParametersuserThe user receiving this member information. Only their nick name, not the full hostmask. (type: str or unicode )
channelThe channel for which this is the member information. (type: str or unicode )
memberInfoFor each member of the given channel, a 7-tuple containing their username, their hostmask, the server to which they are connected, their nickname, the letter "H" or "G" (wtf do these mean?), the hopcount from user to this member, and this member's real name. (type: list of tuples )
def whois(self, user, nick, username, hostname, realName, server, serverInfo, oper, idle, signOn, channels): (source)
Send information about the state of a particular user.
ParametersuserThe user receiving this information. Only their nick name, not the full hostmask. (type: str or unicode )
nickThe nickname of the user this information describes. (type: str or unicode )
usernameThe user's username (eg, ident response) (type: str or unicode )
hostnameThe user's hostmask (type: str )
realNameThe user's real name (type: str or unicode )
serverThe name of the server to which the user is connected (type: str or unicode )
serverInfoA descriptive string about that server (type: str or unicode )
operIndicates whether the user is an IRC operator (type: bool )
idleThe number of seconds since the user last sent a message (type: int )
signOnA POSIX timestamp (number of seconds since the epoch) indicating the time the user signed on (type: int )
channelsA list of the channels which the user is participating in (type: list of str or unicode )
def join(self, who, where): (source)
Send a join message.
ParameterswhoThe name of the user joining. Should be of the form username!ident@hostmask (unless you know better!). (type: str or unicode )
whereThe channel the user is joining. (type: str or unicode )
def part(self, who, where, reason=None): (source)
Send a part message.
ParameterswhoThe name of the user joining. Should be of the form username!ident@hostmask (unless you know better!). (type: str or unicode )
whereThe channel the user is joining. (type: str or unicode )
reasonA string describing the misery which caused this poor soul to depart. (type: str or unicode )
def channelMode(self, user, channel, mode, *args): (source)
Send information about the mode of a channel.
ParametersuserThe user receiving the name list. Only their nick name, not the full hostmask. (type: str or unicode )
channelThe channel for which this is the namelist. (type: str or unicode )
modeA string describing this channel's modes. (type: str )
argsAny additional arguments required by the modes.
API Documentation for Twisted, generated by pydoctor at 2008-10-26 16:12:37.