class IRCUser(irc.IRC): (source)
Implements interfaces: twisted.words.iwords.IChatClient
Protocol instance representing an IRC user connected to the server.
Method | connection |
Called when the connection is shut down. |
Method | connection |
Called when a connection is made. |
Method | group |
Callback notifying this user that the metadata for the given group has changed. |
Method | irc_ |
Join message |
Method | irc_ |
List query |
Method | irc_ |
User mode message |
Method | irc_ |
Names message |
Method | irc_ |
Nick message -- Set your nickname. |
Method | irc_ |
Send a (private) message. |
Method | irc_ |
Oper message |
Method | irc_ |
Part message |
Method | irc_ |
Password message -- Register a password. |
Method | irc_ |
Ping message |
Method | irc_ |
Send a (private) message. |
Method | irc_ |
Quit |
Method | irc_ |
Topic message |
Method | irc_ |
User message -- Set your realname. |
Method | irc_ |
Userhost message |
Method | irc_ |
Who query |
Method | irc_ |
Whois query |
Method | list |
Send a group of LIST response lines |
Method | log |
Undocumented |
Method | receive |
Callback notifying this user of the given message sent by the given user. |
Method | send |
Send a line formatted as an IRC message. |
Method | user |
Callback notifying this user that the given user has joined the given group. |
Method | user |
Callback notifying this user that the given user has left the given group for the given reason. |
Class Variable | encoding |
Undocumented |
Class Variable | groups |
Undocumented |
Instance Variable | avatar |
Undocumented |
Instance Variable | hostname |
Undocumented |
Instance Variable | logout |
Undocumented |
Instance Variable | name |
A short string, unique among users. This will be set by the IChatService at login time. |
Instance Variable | nickname |
Undocumented |
Instance Variable | password |
Undocumented |
Instance Variable | realm |
Undocumented |
Instance Variable | realname |
Undocumented |
Method | _cb |
Undocumented |
Method | _channel |
Undocumented |
Method | _channel |
Undocumented |
Method | _eb |
Undocumented |
Method | _get |
Undocumented |
Method | _send |
Send the topic of the given group to this user, if it has one. |
Method | _set |
Undocumented |
Method | _user |
Undocumented |
Method | _user |
Undocumented |
Class Variable | _motd |
Undocumented |
Class Variable | _welcome |
Undocumented |
Inherited from IRC
:
Method | action |
Send an action to a channel or user. |
Method | channel |
Send information about the mode of a channel. |
Method | data |
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.) |
Method | handle |
Determine the function to call for the given command and call it with the given arguments. |
Method | irc |
Called by handleCommand on a command that doesn't have a defined handler. Subclasses should override this method. |
Method | join |
Send a join message. |
Method | names |
Send the names of a channel's participants to a user. |
Method | notice |
Send a "notice" to a channel or user. |
Method | part |
Send a part message. |
Method | privmsg |
Send a message to a channel or user |
Method | send |
Send to the remote peer a line formatted as an IRC message. |
Method | send |
Undocumented |
Method | topic |
Send the topic to a user. |
Method | topic |
Send the author of and time at which a topic was set for the given channel. |
Method | who |
Send a list of users participating in a channel. |
Method | whois |
Send information about the state of a particular user. |
Instance Variable | buffer |
Undocumented |
Instance Variable | channels |
Undocumented |
Method | _escape |
Escape the given tag value according to escaping rules in IRCv3. |
Method | _string |
Converts a tag dictionary to a string. |
Method | _validate |
Checks the tag dict for errors and raises ValueError if an error is found. |
Inherited from Protocol
(via IRC
):
Method | log |
Return a prefix matching the class name, to identify log messages related to this protocol instance. |
Class Variable | factory |
Undocumented |
Inherited from BaseProtocol
(via IRC
, Protocol
):
Method | make |
Make a connection to a transport and a server. |
Instance Variable | connected |
Undocumented |
Instance Variable | transport |
Undocumented |
Called when the connection is shut down.
Clear any circular references here, and any external references to this Protocol. The connection has been closed.
Parameters | |
reason:twisted.python.failure.Failure | Undocumented |
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.
Callback notifying this user that the metadata for the given group has changed.
Parameters | |
group:IGroup | Undocumented |
meta:dict | Undocumented |
Returns | |
twisted.internet.defer.Deferred | Undocumented |
List query
Return information about the indicated channels, or about all channels if none are specified.
Parameters: [ <channel> *( "," <channel> ) [ <target> ] ]
Password message -- Register a password.
Parameters: <password>
[REQUIRED]
Note that IRC requires the client send this *before* NICK and USER.
Send a group of LIST response lines
Parameters | |
channels:list of (str, int, str) | Information about the channels being sent: their name, the number of participants, and their topic. |
Callback notifying this user of the given message sent by the given user.
This will be invoked whenever another user sends a message to a group this user is participating in, or whenever another user sends a message directly to this user. In the former case, recipient will be the group to which the message was sent; in the latter, it will be the same object as the user who is receiving the message.
Parameters | |
sender:IUser | Undocumented |
recipient:IUser or IGroup | Undocumented |
message:dict | Undocumented |
Returns | |
twisted.internet.defer.Deferred | A Deferred which fires when the message has been delivered, or which fails in some way. If the Deferred fails and the message was directed at a group, this user will be removed from that group. |
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'.
The sendCommand
method is generally preferred over this one. Notably, this method does not support sending message tags, while the sendCommand
method does.
Callback notifying this user that the given user has joined the given group.
Parameters | |
group:IGroup | Undocumented |
user:IUser | Undocumented |
Returns | |
twisted.internet.defer.Deferred | Undocumented |
Callback notifying this user that the given user has left the given group for the given reason.
Parameters | |
group:IGroup | Undocumented |
user:IUser | Undocumented |
reason:unicode | Undocumented |
Returns | |
twisted.internet.defer.Deferred | Undocumented |