The Protocol of our IRC-Bot

Instance Variable plugins contains references to all plugins, which are loaded (type: list)
Instance Variable channels all channels we are currently in (type: list)
Instance Variable network the name of the network we are connected to (type: string)
Instance Variable logger a instance of the standard python logger
Instance Variable nickname the nick of the bot
Method __init__ Undocumented
Method handleCommand same as twisteds, only with reasonable logging in case of exceptions
Method startTimeoutDetection initialize the timeout-detection scheduler-call
Method getUsers Get a list of users in channel (or all channels if channel=None) @rtype: dict @return: a list of users
Method getUserByNick Undocumented
Method register_ctl_command Undocumented
Method register_my_commands Undocumented
Method getFactory get the factory @rtype: BotFactory @return: the current factory
Method auth No summary
Method encode_line No summary
Method get_gettext Undocumented
Method sendmsg No summary
Method sendme No summary
Method join wrapper around IRCClient.join, which only allows proper channels
Method leave wrapper around IRCClient.leave, which only allows proper channels
Method kick wrapper around IRCClient.kick, which only allows proper channels
Method topic wrapper around IRCClient.topic, which only allows proper channels
Method connectionMade this is called by twisted , when the connection to the irc-server was made
Method connectionLost this is called by twisted, if the connection to the IRC-Server was lost @type reason: twisted.python.failure.Failure
Method signedOn called by twisted, when we signed on the IRC-Server
Method joined No summary
Method left No summary
Method nickChanged Undocumented
Method isupport Undocumented
Method toUnicode convert a string to an unicode-object, trying to use the encoding given in config, with fallback to iso-8859-15
Method resolveUser No summary
Method privmsg No summary
Method irc_unknown called by twisted for every line that has no own callback
Method noticed No summary
Method action No summary
Method modeChanged called by twisted if a usermode was changed
Method kickedFrom called by twisted, if the bot was kicked
Method userKicked called by twisted, if a user was kicked
Method userJoined called by twisted, if a user joined the channel
Method userLeft called by twisted, if a user left the channel
Method userQuit called by twisted, if a user quits
Method yourHost called by twisted with information about the IRC-Server we are connected to
Method ctcpUnknownQuery called by twisted, if a user sent a ctcp query
Method ctcpUnknownReply called by twisted, if a user sent a ctcp reply
Method userRenamed called by twisted, if a user changed his nick
Method topicUpdated called by twisted if the topic was updated
Method irc_RPL_WHOREPLY "<channel> <user> <host> <server> <nick> <H|G>[*][@|+] :<hopcount> <real name>"
Method irc_RPL_ENDOFWHO end of WHO replies by the server
Method irc_INVITE called by twisted, if the bot was invited
Method irc_RPL_BOUNCE Overridden to get isupport work correctly
Method irc_JOIN Overridden to get the full hostmask
Method irc_PART Overridden to get the full hostmask
Method irc_QUIT Overridden to get the full hostmask
Method irc_RPL_ENDOFMOTD Undocumented
Method lineReceived called by twisted for every line which was received from the IRC-Server
Method sendLine Undocumented
Method ping Undocumented
Method disconnect disconnects cleanly from the current network
Method _synced_apirunner Undocumented
Method _check_sendLastLine Undocumented
plugins =
contains references to all plugins, which are loaded (type: list)
channels =
all channels we are currently in (type: list)
network =
the name of the network we are connected to (type: string)
logger =
a instance of the standard python logger
nickname =
the nick of the bot
def __init__(self, root, parent): (source)
Undocumented
def _synced_apirunner(self, apifunction, args={}): (source)
Undocumented
def handleCommand(self, command, prefix, params): (source)

same as twisteds, only with reasonable logging in case of exceptions

Determine the function to call for the given command and call it with the given arguments.

def startTimeoutDetection(self): (source)

initialize the timeout-detection scheduler-call

def getUsers(self, channel=None): (source)

Get a list of users in channel (or all channels if channel=None)

Returnsa list of users (type: dict)
def getUserByNick(self, nick): (source)
Undocumented
def _check_sendLastLine(self): (source)
Undocumented
def register_ctl_command(self, f, namespace=None, name=None): (source)
Undocumented
def register_my_commands(self): (source)
Undocumented
def getFactory(self): (source)

get the factory

Returnsthe current factory (type: BotFactory)
def auth(self, user): (source)

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 encode_line(self, line, encoding, fallback): (source)

encode a line, trying to use encoding, falling back to fallback

def get_gettext(self, channel=None): (source)
Undocumented
def sendmsg(self, channel, msg, encoding='UTF-8', fallback='iso-8859-15'): (source)

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='UTF-8', fallback='iso8859-15'): (source)

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)
fallbackthe encoding of msg
def join(self, channel, key=None): (source)

wrapper around IRCClient.join, which only allows proper channels

def leave(self, channel, reason=None): (source)

wrapper around IRCClient.leave, which only allows proper channels

def kick(self, channel, user, reason=None): (source)

wrapper around IRCClient.kick, which only allows proper channels

def topic(self, channel, topic=None): (source)

wrapper around IRCClient.topic, which only allows proper channels

def connectionMade(self): (source)

this is called by twisted , when the connection to the irc-server was made

def connectionLost(self, reason): (source)

this is called by twisted, if the connection to the IRC-Server was lost

def signedOn(self): (source)

called by twisted, when we signed on the IRC-Server

def joined(self, channel): (source)

called by twisted, if we joined a channel

Parameterschannelthe channel we joined (type: string)
@syncedChannel(0)
def left(self, channel): (source)

called by twisted, if we left a channel

Parameterschannelthe channel we left (type: string)
def nickChanged(self, nick): (source)
Undocumented
def isupport(self, options): (source)
Undocumented
def toUnicode(self, the_string, network=None, channel=None): (source)

convert a string to an unicode-object, trying to use the encoding given in config, with fallback to iso-8859-15

def resolveUser(self, user): (source)

resolve a user hostmask (nick!user@host) to a userobject returns a known user, if its in the user_list. creates a new user_list entry, if possible. if only nick is known, it returns a incomplete user and does not store it in the user_list

def privmsg(self, user, channel, msg): (source)

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)
@syncedAll
def irc_unknown(self, prefix, command, params): (source)

called by twisted for every line that has no own callback

@syncedChannel(1)
def noticed(self, user, channel, msg): (source)

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)
@syncedChannel(1)
def action(self, user, channel, msg): (source)

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)
@syncedChannel(1)
def modeChanged(self, user, chan, set, modes, args): (source)

called by twisted if a usermode was changed

@syncedChannel(0)
def kickedFrom(self, channel, kicker, message): (source)

called by twisted, if the bot was kicked

@syncedChannel(1)
def userKicked(self, kickee, channel, kicker, message): (source)

called by twisted, if a user was kicked

@syncedChannel(1)
def userJoined(self, user, channel): (source)

called by twisted, if a user joined the channel

@syncedChannel(1)
def userLeft(self, user, channel): (source)

called by twisted, if a user left the channel

@syncedAll
def userQuit(self, user, quitMessage): (source)

called by twisted, if a user quits

def yourHost(self, info): (source)

called by twisted with information about the IRC-Server we are connected to

@syncedChannel(1)
def ctcpUnknownQuery(self, user, channel, messages): (source)

called by twisted, if a user sent a ctcp query

@syncedChannel(1)
def ctcpUnknownReply(self, user, channel, tag, data): (source)

called by twisted, if a user sent a ctcp reply

@syncedAll
def userRenamed(self, oldname, newname): (source)

called by twisted, if a user changed his nick

@syncedChannel(1)
def topicUpdated(self, user, channel, newTopic): (source)

called by twisted if the topic was updated

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

"<channel> <user> <host> <server> <nick> <H|G>[*][@|+] :<hopcount> <real name>"

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

end of WHO replies by the server

@syncedChannelRaw
def irc_INVITE(self, prefix, params): (source)

called by twisted, if the bot was invited

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

Overridden to get isupport work correctly

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

Overridden to get the full hostmask

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

Overridden to get the full hostmask

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

Overridden to get the full hostmask

def irc_RPL_ENDOFMOTD(self, prefix, params): (source)
Undocumented
def lineReceived(self, line): (source)

called by twisted for every line which was received from the IRC-Server

def sendLine(self, line): (source)
Undocumented
def ping(self): (source)
Undocumented
def disconnect(self): (source)

disconnects cleanly from the current network

API Documentation for OtfBot, generated by pydoctor at 2020-03-04 02:00:06.