Class b.Bot(irc.IRCClient):

Part of bot View In Hierarchy

The Protocol of our IRC-Bot
Instance Variablesmodscontains references to all modules, which are loaded (type: list )
userscontains a dict of all users in the channels we are in (type: dict )
channelsall channels we are currently in (type: list )
networkthe name of the network we are connected to (type: string )
loggera instance of the standard python logger
schedulera instance of the Scheduler
nicknamethe nick of the bot
Method __init__ Undocumented
Method getUsers Get a list of users
Method getFactory get the factory
Method auth call this, to see which rights user has
Class WontStart Undocumented
Class DependencyMissing Undocumented
Method depends raise an Exception, if the dependency is not active
Method sendmsg call only this to send messages to channels or users
Method sendme call only this to send actions (/me) to channels
Method reloadModuleClass Undocumented
Method restartModule Undocumented
Method reloadModules call this to reload all modules
Method stopMod Undocumented
Method startMods initializes all known modules
Method startMod Undocumented
Method connectionMade this is called by twisted
Method connectionLost this is called by twisted,
Method signedOn called by twisted,
Method joined called by twisted,
Method left called by twisted,
Method command callback for !commands
Method privmsg called by twisted,
Method irc_unknown called by twisted
Method noticed called by twisted,
Method action called by twisted,
Method modeChanged called by twisted
Method kickedFrom called by twisted,
Method userKicked called by twisted,
Method userJoined called by twisted,
Method userLeft called by twisted,
Method userQuit called by twisted,
Method yourHost called by twisted
Method ctcpQuery called by twisted,
Method userRenamed called by twisted,
Method topicUpdated called by twisted
Method irc_RPL_ENDOFNAMES Undocumented
Method irc_RPL_NAMREPLY Undocumented
Method lineReceived called by twisted
Method sendLine Sends a line to the other end of the connection.
Method logerror format a exception nicely and pass it to the logger
Method disconnect disconnects cleanly from the current network
Method _apirunner Pass all calls to modules callbacks through this method, they

Inherited from IRCClient:

Method created Called with creation date information about the server, usually at logon.
Method myInfo Called with information about the server, usually at logon.
Method luserClient Called with information about the number of connections, usually at logon.
Method bounce Called with information about where the client should reconnect.
Method isupport Called with various information about what the server supports.
Method luserChannels Called with the number of channels existant on the server.
Method luserOp Called with the number of ops logged on to the server.
Method luserMe Called with information about the server connected to.
Method pong Called with the results of a CTCP PING query.
Method nickChanged Called when my nick has been changed.
Method receivedMOTD I received a message-of-the-day banner from the server.
Method join Join a channel.
Method leave Leave a channel.
Method kick Attempt to kick a user from a channel.
Method topic Attempt to set the topic of the given channel, or ask what it is.
Method mode Change the modes on a user or channel.
Method say Send a message to a channel
Method msg Send a message to a user or channel.
Method notice Send a notice to a user.
Method away Mark this client as away.
Method back Clear the away status.
Method whois Retrieve user information about the given nick name.
Method register Login to the server.
Method setNick Set this client's nickname.
Method quit Disconnect from the server
Method describe Strike a pose.
Method me Strike a pose.
Method ping Measure round-trip delay to another IRC client.
Method dccSend Undocumented
Method dccResume Send a DCC RESUME request to another user.
Method dccAcceptResume Send a DCC ACCEPT response to clients who have requested a resume.
Method irc_ERR_NICKNAMEINUSE Called when we try to register or change to a nickname that is already
Method alterCollidedNick Generate an altered version of a nickname that caused a collision in an
Method irc_ERR_ERRONEUSNICKNAME Called when we try to register or change to an illegal nickname.
Method irc_ERR_PASSWDMISMATCH Called when the login was incorrect.
Method irc_RPL_WELCOME Called when we have received the welcome from the server.
Method irc_JOIN Called when a user joins a channel.
Method irc_PART Called when a user leaves a channel.
Method irc_QUIT Called when a user has quit.
Method irc_MODE Parse a server mode change message.
Method irc_PING Called when some has pinged us.
Method irc_PRIVMSG Called when we get a message.
Method irc_NOTICE Called when a user gets a notice.
Method irc_NICK Called when a user changes their nickname.
Method irc_KICK Called when a user is kicked from a channel.
Method irc_TOPIC Someone in the channel set the topic.
Method irc_RPL_TOPIC Called when the topic for a channel is initially reported or when it
Method irc_RPL_NOTOPIC Undocumented
Method irc_RPL_MOTDSTART Undocumented
Method irc_RPL_MOTD Undocumented
Method irc_RPL_ENDOFMOTD RPL_ENDOFMOTD indicates the end of the message of the day
Method irc_RPL_CREATED Undocumented
Method irc_RPL_YOURHOST Undocumented
Method irc_RPL_MYINFO Undocumented
Method irc_RPL_BOUNCE Undocumented
Method irc_RPL_ISUPPORT Undocumented
Method irc_RPL_LUSERCLIENT Undocumented
Method irc_RPL_LUSEROP Undocumented
Method irc_RPL_LUSERCHANNELS Undocumented
Method irc_RPL_LUSERME Undocumented
Method ctcpQuery_ACTION Undocumented
Method ctcpQuery_PING Undocumented
Method ctcpQuery_FINGER Undocumented
Method ctcpQuery_VERSION Undocumented
Method ctcpQuery_SOURCE Undocumented
Method ctcpQuery_USERINFO Undocumented
Method ctcpQuery_CLIENTINFO A master index of what CTCP tags this client knows.
Method ctcpQuery_ERRMSG Undocumented
Method ctcpQuery_TIME Undocumented
Method ctcpQuery_DCC Initiate a Direct Client Connection
Method dcc_SEND Undocumented
Method dcc_ACCEPT Undocumented
Method dcc_RESUME Undocumented
Method dcc_CHAT Undocumented
Method dccDoSend Called when I receive a DCC SEND offer from a client.
Method dccDoResume Called when a client is trying to resume an offered file
Method dccDoAcceptResume Called when a client has verified and accepted a DCC resume
Method dccDoChat Undocumented
Method ctcpUnknownQuery Undocumented
Method ctcpMakeReply Send one or more extended messages as a CTCP reply.
Method ctcpMakeQuery Send one or more extended messages as a CTCP query.
Method ctcpReply Dispatch method for any CTCP replies received.
Method ctcpReply_PING Undocumented
Method ctcpUnknownReply Called when a fitting ctcpReply_ method is not found.
Method badMessage When I get a message that's so broken I can't use it.
Method quirkyMessage This is called when I receive a message which is peculiar,
Method dataReceived Protocol.dataReceived.
Method getUserModeParams Get user modes that require parameters for correct parsing.
Method getChannelModeParams Get channel modes that require parameters for correct parsing.
Method handleCommand Determine the function to call for the given command and call
Method __getstate__ Undocumented
Method _reallySendLine Undocumented
Method _sendLine Undocumented

Inherited from LineReceiver (via IRCClient):

Method clearLineBuffer Clear buffered data.
Method setLineMode Sets the line-mode of this receiver.
Method setRawMode Sets the raw mode of this receiver.
Method rawDataReceived Override this for when raw data is received.
Method lineLengthExceeded Called when the maximum line length has been reached.

Inherited from BaseProtocol (via IRCClient, LineReceiver, Protocol):

Method makeConnection Make a connection to a transport and a server.

Inherited from _PauseableMixin (via IRCClient, LineReceiver):

Method pauseProducing Undocumented
Method resumeProducing Undocumented
Method stopProducing Undocumented
def __init__(self, config, classes, network):
Undocumented
def _apirunner(self, apifunction, args={}):
Pass all calls to modules callbacks through this method, they are checked whether they should be executed or not.

Example self._apirunner("privmsg",{"user":user,"channel":channel,"msg":msg})

Parametersapifunctionthe name of the callback function (type: string )
argsthe arguments for the callback (type: dict )
def getUsers(self):
Get a list of users
Returnsa dict with the channelnames as keys (type: dict )
def getFactory(self):
get the factory
Returnsthe current factory (type: BotFactory )
def auth(self, user):
call this, to see which rights user has
Parametersuserthe full hostmask of the user (type: string )
Returnsthe level of access rights (0 = nothing, 10 = everything) (type: int )
def depends(self, dependency):
raise an Exception, if the dependency is not active
def sendmsg(self, channel, msg, encoding='iso-8859-15', fallback='iso-8859-15'):
call only this to send messages to channels or users it converts the message from iso-8859-15 to a encoding given in the config
Parameterschannelsend the message to this channel or user (type: string )
msgthe message to send (type: string )
encodingthe encoding of msg (type: string )
fallbacktry this one as encoding for msg, if encoding doesn't work (type: string )
def sendme(self, channel, action, encoding='iso-8859-15'):
call only this to send actions (/me) to channels it converts the message from iso-8859-15 to a encoding given in the config
Parameterschannelsend the message to this channel or user (type: string )
actionthe message to send (type: string )
encodingthe encoding of msg (type: string )
def reloadModuleClass(self, moduleClass):
Undocumented
def restartModule(self, moduleName, network):
Undocumented
def reloadModules(self, all=True):
call this to reload all modules
def stopMod(self, moduleName):
Undocumented
def startMods(self):
initializes all known modules
def startMod(self, moduleClass):
Undocumented
def connectionMade(self):
this is called by twisted , when the connection to the irc-server was made
def connectionLost(self, reason):
this is called by twisted, if the connection to the IRC-Server was lost
Parametersreason (type: twisted.python.failure.Failure )
def signedOn(self):
called by twisted, when we signed on the IRC-Server
def joined(self, channel):
called by twisted, if we joined a channel
Parameterschannelthe channel we joined (type: string )
def left(self, channel):
called by twisted, if we left a channel
Parameterschannelthe channel we left (type: string )
def command(self, user, channel, command, options):
callback for !commands
Parametersuserthe user, which issues the command (type: string )
channelthe channel to which the message was sent or my nickname if it was a private message (type: string )
commandthe !command without the ! (type: string )
optionseventual options specified after !command (e.g. "!command foo") (type: string )
def privmsg(self, user, channel, msg):
called by twisted, if we received a message
Parametersuserthe user, which send the message (type: string )
channelthe channel to which the message was sent or my nickname if it was a private message (type: string )
msgthe message (type: string )
def irc_unknown(self, prefix, command, params):
called by twisted for every line that has no own callback
def noticed(self, user, channel, msg):
called by twisted, if we got a notice
Parametersuserthe user which send the notice (type: string )
channelthe channel to which the notice was sent (could be our nick, if the message was only sent to us) (type: string )
msgthe message (type: string )
def action(self, user, channel, message):
called by twisted, if we received a action
Parametersuserthe user which send the action (type: string )
channelthe channel to which the action was sent (could be our nick, if the message was only sent to us) (type: string )
msgthe message (type: string )
def modeChanged(self, user, channel, set, modes, args):
called by twisted if a usermode was changed
def kickedFrom(self, channel, kicker, message):
called by twisted, if the bot was kicked
def userKicked(self, kickee, channel, kicker, message):
called by twisted, if a user was kicked
def userJoined(self, user, channel):
called by twisted, if a user joined the channel
def userLeft(self, user, channel):
called by twisted, if a user left the channel
def userQuit(self, user, quitMessage):
called by twisted, of a user quits
def yourHost(self, info):
called by twisted with information about the IRC-Server we are connected to
def ctcpQuery(self, user, channel, messages):
called by twisted, if a user sent a ctcp query
def userRenamed(self, oldname, newname):
called by twisted, if a user changed his nick
def topicUpdated(self, user, channel, newTopic):
called by twisted if the topic was updated
def irc_RPL_ENDOFNAMES(self, prefix, params):
Undocumented
def irc_RPL_NAMREPLY(self, prefix, params):
Undocumented
def lineReceived(self, line):
called by twisted for every line which was received from the IRC-Server
def sendLine(self, line):
Sends a line to the other end of the connection.
def logerror(self, logger, module, exception):
format a exception nicely and pass it to the logger
Parametersloggerthe logger instance to use
modulethe module in which the exception occured (type: string )
exceptionthe exception (type: exception )
def disconnect(self):
disconnects cleanly from the current network
API Documentation for OtfBot, generated by pydoctor at 2010-01-14 18:51:57.