class documentation

class IRCUser(irc.IRC): (source)

Implements interfaces: twisted.words.iwords.IChatClient

View In Hierarchy

Protocol instance representing an IRC user connected to the server.
Method connection​Lost Called when the connection is shut down.
Method connection​Made Called when a connection is made.
Method group​Meta​Update Callback notifying this user that the metadata for the given group has changed.
Method irc_​JOIN Join message
Method irc_​LIST List query
Method irc_​MODE User mode message
Method irc_​NAMES Names message
Method irc_​NICK Nick message -- Set your nickname.
Method irc_​NICKSERV_​PRIVMSG Send a (private) message.
Method irc_​OPER Oper message
Method irc_​PART Part message
Method irc_​PASS Password message -- Register a password.
Method irc_​PING Ping message
Method irc_​PRIVMSG Send a (private) message.
Method irc_​QUIT Quit
Method irc_​TOPIC Topic message
Method irc_​USER User message -- Set your realname.
Method irc_​USERHOST Userhost message
Method irc_​WHO Who query
Method irc_​WHOIS Whois query
Method list Send a group of LIST response lines
Method log​In​As Undocumented
Method receive Callback notifying this user of the given message sent by the given user.
Method send​Message Send a line formatted as an IRC message.
Method user​Joined Callback notifying this user that the given user has joined the given group.
Method user​Left 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​Login Undocumented
Method _channel​Mode Undocumented
Method _channel​Who Undocumented
Method _eb​Login Undocumented
Method _get​Topic Undocumented
Method _send​Topic Send the topic of the given group to this user, if it has one.
Method _set​Topic Undocumented
Method _user​Mode Undocumented
Method _user​Who Undocumented
Class Variable _motd​Messages Undocumented
Class Variable _welcome​Messages Undocumented

Inherited from IRC:

Method action Send an action to a channel or user.
Method channel​Mode Send information about the mode of a channel.
Method data​Received 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​Command Determine the function to call for the given command and call it with the given arguments.
Method irc​_unknown 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​Command Send to the remote peer a line formatted as an IRC message.
Method send​Line Undocumented
Method topic Send the topic to a user.
Method topic​Author 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​Tag​Value Escape the given tag value according to escaping rules in IRCv3.
Method _string​Tags Converts a tag dictionary to a string.
Method _validate​Tags Checks the tag dict for errors and raises ValueError if an error is found.

Inherited from Protocol (via IRC):

Method log​Prefix 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​Connection Make a connection to a transport and a server.
Instance Variable connected Undocumented
Instance Variable transport Undocumented
def connectionLost(self, reason): (source)

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.FailureUndocumented
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 groupMetaUpdate(self, group, meta): (source)
Callback notifying this user that the metadata for the given group has changed.
Parameters
group:IGroupUndocumented
meta:dictUndocumented
Returns
twisted.internet.defer.DeferredUndocumented
def irc_JOIN(self, prefix, params): (source)

Join message

Parameters: ( <channel> *( "," <channel> ) [ <key> *( "," <key> ) ] )

def irc_LIST(self, prefix, params): (source)

List query

Return information about the indicated channels, or about all channels if none are specified.

Parameters: [ <channel> *( "," <channel> ) [ <target> ] ]

def irc_MODE(self, prefix, params): (source)

User mode message

Parameters: <nickname> *( ( "+" / "-" ) *( "i" / "w" / "o" / "O" / "r" ) )

def irc_NAMES(self, prefix, params): (source)

Names message

Parameters: [ <channel> *( "," <channel> ) [ <target> ] ]

def irc_NICK(self, prefix, params): (source)

Nick message -- Set your nickname.

Parameters: <nickname>

[REQUIRED]

def irc_NICKSERV_PRIVMSG(self, prefix, params): (source)

Send a (private) message.

Parameters: <msgtarget> <text to be sent>

def irc_OPER(self, prefix, params): (source)

Oper message

Parameters: <name> <password>

def irc_PART(self, prefix, params): (source)

Part message

Parameters: <channel> *( "," <channel> ) [ <Part Message> ]

def irc_PASS(self, prefix, params): (source)

Password message -- Register a password.

Parameters: <password>

[REQUIRED]

Note that IRC requires the client send this *before* NICK and USER.

def irc_PING(self, prefix, params): (source)

Ping message

Parameters: <server1> [ <server2> ]

def irc_PRIVMSG(self, prefix, params): (source)

Send a (private) message.

Parameters: <msgtarget> <text to be sent>

def irc_QUIT(self, prefix, params): (source)

Quit

Parameters: [ <Quit Message> ]

def irc_TOPIC(self, prefix, params): (source)

Topic message

Parameters: <channel> [ <topic> ]

def irc_USER(self, prefix, params): (source)

User message -- Set your realname.

Parameters: <user> <mode> <unused> <realname>

def irc_USERHOST(self, prefix, params): (source)

Userhost message

Parameters: <nickname> *( SPACE <nickname> )

[Optional]

def irc_WHO(self, prefix, params): (source)

Who query

Parameters: [ <mask> [ "o" ] ]

def irc_WHOIS(self, prefix, params): (source)

Whois query

Parameters: [ <target> ] <mask> *( "," <mask> )

def list(self, channels): (source)
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.
def logInAs(self, nickname, password): (source)

Undocumented

def receive(self, sender, recipient, message): (source)

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:IUserUndocumented
recipient:IUser or IGroupUndocumented
message:dictUndocumented
Returns
twisted.internet.defer.DeferredA 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.
def sendMessage(self, command, *parameter_list, **kw): (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'.

The sendCommand method is generally preferred over this one. Notably, this method does not support sending message tags, while the sendCommand method does.

def userJoined(self, group, user): (source)
Callback notifying this user that the given user has joined the given group.
Parameters
group:IGroupUndocumented
user:IUserUndocumented
Returns
twisted.internet.defer.DeferredUndocumented
def userLeft(self, group, user, reason=None): (source)
Callback notifying this user that the given user has left the given group for the given reason.
Parameters
group:IGroupUndocumented
user:IUserUndocumented
reason:unicodeUndocumented
Returns
twisted.internet.defer.DeferredUndocumented
groups = (source)

Undocumented

avatar = (source)

Undocumented

logout = (source)

Undocumented

name = (source)
A short string, unique among users. This will be set by the IChatService at login time.
nickname = (source)

Undocumented

password = (source)

Undocumented

realm = (source)

Undocumented

realname = (source)

Undocumented

def _cbLogin(self, result): (source)

Undocumented

def _channelMode(self, group, modes=None, *args): (source)

Undocumented

def _channelWho(self, group): (source)

Undocumented

def _ebLogin(self, err, nickname): (source)

Undocumented

def _getTopic(self, channel): (source)

Undocumented

def _sendTopic(self, group): (source)
Send the topic of the given group to this user, if it has one.
def _setTopic(self, channel, topic): (source)

Undocumented

def _userMode(self, user, modes=None): (source)

Undocumented

def _userWho(self, user): (source)

Undocumented

_motdMessages = (source)

Undocumented

_welcomeMessages = (source)

Undocumented