class documentation

class Bot(pluginSupport, irc.IRCClient): (source)

View In Hierarchy

The Protocol of our IRC-Bot

Method __init__ Undocumented
Method action called by twisted, if we received a action
Method auth call this, to see which rights user has
Method connectionLost this is called by twisted, if the connection to the IRC-Server was lost
Method connectionMade this is called by twisted , when the connection to the irc-server was made
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 disconnect disconnects cleanly from the current network
Method get_gettext Undocumented
Method getFactory get the factory
Method getUserByNick Undocumented
Method getUsers Get a list of users in channel (or all channels if channel=None)
Method handleCommand same as twisteds, only with reasonable logging in case of exceptions
Method irc_INVITE called by twisted, if the bot was invited
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_BOUNCE Overridden to get isupport work correctly
Method irc_RPL_ENDOFMOTD Undocumented
Method irc_RPL_ENDOFWHO end of WHO replies by the server
Method irc_RPL_WHOREPLY "<channel> <user> <host> <server> <nick> <H|G>[*][@|+] :<hopcount> <real name>"
Method irc_unknown called by twisted for every line that has no own callback
Method isupport Undocumented
Method join wrapper around IRCClient.join, which only allows proper channels
Method joined called by twisted, if we joined a channel
Method kick wrapper around IRCClient.kick, which only allows proper channels
Method kickedFrom called by twisted, if the bot was kicked
Method leave wrapper around IRCClient.leave, which only allows proper channels
Method left called by twisted, if we left a channel
Method lineReceived called by twisted for every line which was received from the IRC-Server
Method modeChanged called by twisted if a usermode was changed
Method nickChanged Undocumented
Method noticed called by twisted, if we got a notice
Method ping Undocumented
Method privmsg called by twisted, if we received a message
Method register_ctl_command Undocumented
Method register_my_commands Undocumented
Method resolveUser 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...
Method sendLine Undocumented
Method sendme call only this to send actions (/me) to channels it converts the message from iso-8859-15 to a encoding given in the config
Method sendmsg 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
Method signedOn called by twisted, when we signed on the IRC-Server
Method startTimeoutDetection initialize the timeout-detection scheduler-call
Method topic wrapper around IRCClient.topic, which only allows proper channels
Method topicUpdated called by twisted if the topic was updated
Method toUnicode convert a string to an unicode-object, trying to use the encoding given in config, with fallback to iso-8859-15
Method userJoined called by twisted, if a user joined the channel
Method userKicked called by twisted, if a user was kicked
Method userLeft called by twisted, if a user left the channel
Method userQuit called by twisted, if a user quits
Method userRenamed called by twisted, if a user changed his nick
Method yourHost called by twisted with information about the IRC-Server we are connected to
Class Variable erroneousNickFallback Undocumented
Class Variable modchars Undocumented
Class Variable modcharvals Undocumented
Class Variable pluginSupportName Undocumented
Class Variable pluginSupportPath Undocumented
Class Variable sourceURL Undocumented
Instance Variable callback_queue Undocumented
Instance Variable channelmodes Undocumented
Instance Variable channels all channels we are currently in
Instance Variable config Undocumented
Instance Variable factory Undocumented
Instance Variable hostmask Undocumented
Instance Variable ircClient Undocumented
Instance Variable lastLine Undocumented
Instance Variable lineRate Undocumented
Instance Variable logger a instance of the standard python logger
Instance Variable mymodes Undocumented
Instance Variable network the name of the network we are connected to
Instance Variable nickname the nick of the bot
Instance Variable parent Undocumented
Instance Variable password Undocumented
Instance Variable plugins contains references to all plugins, which are loaded
Instance Variable realname Undocumented
Instance Variable rev_modchars Undocumented
Instance Variable rev_modcharvals Undocumented
Instance Variable root Undocumented
Instance Variable serversupports Undocumented
Instance Variable sync_lock Undocumented
Instance Variable syncing_channels Undocumented
Instance Variable translations Undocumented
Instance Variable user_list Undocumented
Instance Variable versionEnv Undocumented
Instance Variable versionName Undocumented
Instance Variable versionNum Undocumented
Method _check_sendLastLine Undocumented
Method _synced_apirunner Undocumented
def __init__(self, root, parent): (source)

Undocumented

@syncedChannel(argnum=1)
def action(self, user, channel, msg): (source)

called by twisted, if we received a action

Parameters
user:stringthe user which send the action
channel:stringthe channel to which the action was sent (could be our nick, if the message was only sent to us)
msg:stringthe message
def auth(self, user): (source)

call this, to see which rights user has

Parameters
user:stringthe full hostmask of the user
Returns
intthe level of access rights (0 = nothing, 10 = everything)
def connectionLost(self, reason): (source)

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

Parameters
reason:twisted.python.failure.FailureUndocumented
def connectionMade(self): (source)

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

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

called by twisted, if a user sent a ctcp query

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

called by twisted, if a user sent a ctcp reply

def disconnect(self): (source)

disconnects cleanly from the current network

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

Undocumented

def getFactory(self): (source)

get the factory

Returns
BotFactorythe current factory
def getUserByNick(self, nick): (source)

Undocumented

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

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

Returns
dicta list of users
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.

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

called by twisted, if the bot was invited

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_BOUNCE(self, prefix, params): (source)

Overridden to get isupport work correctly

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

Undocumented

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

end of WHO replies by the server

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

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

@syncedAll
def irc_unknown(self, prefix, command, params): (source)

called by twisted for every line that has no own callback

def isupport(self, options): (source)

Undocumented

def join(self, channel, key=None): (source)

wrapper around IRCClient.join, which only allows proper channels

def joined(self, channel): (source)

called by twisted, if we joined a channel

Parameters
channel:stringthe channel we joined
def kick(self, channel, user, reason=None): (source)

wrapper around IRCClient.kick, which only allows proper channels

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

called by twisted, if the bot was kicked

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

wrapper around IRCClient.leave, which only allows proper channels

@syncedChannel(argnum=0)
def left(self, channel): (source)

called by twisted, if we left a channel

Parameters
channel:stringthe channel we left
def lineReceived(self, line): (source)

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

@syncedChannel(argnum=1)
def modeChanged(self, user, chan, set, modes, args): (source)

called by twisted if a usermode was changed

def nickChanged(self, nick): (source)

Undocumented

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

called by twisted, if we got a notice

Parameters
user:stringthe user which send the notice
channel:stringthe channel to which the notice was sent (could be our nick, if the message was only sent to us)
msg:stringthe message
def ping(self): (source)

Undocumented

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

called by twisted, if we received a message

Parameters
user:stringthe user, which send the message
channel:stringthe channel to which the message was sent or my nickname if it was a private message
msg:stringthe message
def register_ctl_command(self, f, namespace=None, name=None): (source)

Undocumented

def register_my_commands(self): (source)

Undocumented

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 sendLine(self, line): (source)

Undocumented

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

Parameters
channel:stringsend the message to this channel or user
action:stringthe message to send
encoding:stringthe encoding of msg
fallbackthe encoding of msg
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

Parameters
channel:stringsend the message to this channel or user
msg:stringthe message to send
encoding:stringthe encoding of msg
fallback:stringtry this one as encoding for msg, if encoding doesn't work
def signedOn(self): (source)

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

def startTimeoutDetection(self): (source)

initialize the timeout-detection scheduler-call

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

wrapper around IRCClient.topic, which only allows proper channels

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

called by twisted if the topic was updated

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

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

called by twisted, if a user joined the channel

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

called by twisted, if a user was kicked

@syncedChannel(argnum=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

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

called by twisted, if a user changed his nick

def yourHost(self, info): (source)

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

erroneousNickFallback: str = (source)

Undocumented

modchars: dict[int, str] = (source)

Undocumented

modcharvals: dict[int, str] = (source)

Undocumented

pluginSupportName: str = (source)

Undocumented

pluginSupportPath: str = (source)

Undocumented

sourceURL: str = (source)

Undocumented

callback_queue: list = (source)

Undocumented

channelmodes: dict = (source)

Undocumented

channels: list = (source)

all channels we are currently in

Undocumented

Undocumented

hostmask = (source)

Undocumented

ircClient = (source)

Undocumented

lastLine = (source)

Undocumented

lineRate = (source)

Undocumented

a instance of the standard python logger

mymodes: dict = (source)

Undocumented

network: string = (source)

the name of the network we are connected to

nickname = (source)

the nick of the bot

Undocumented

password = (source)

Undocumented

plugins: list = (source)

contains references to all plugins, which are loaded

realname = (source)

Undocumented

rev_modchars = (source)

Undocumented

rev_modcharvals = (source)

Undocumented

Undocumented

serversupports: dict = (source)

Undocumented

sync_lock = (source)

Undocumented

syncing_channels: list = (source)

Undocumented

translations: dict = (source)

Undocumented

user_list: dict = (source)

Undocumented

versionEnv: str = (source)

Undocumented

versionName: str = (source)

Undocumented

versionNum = (source)

Undocumented

def _check_sendLastLine(self): (source)

Undocumented

def _synced_apirunner(self, apifunction, args={}): (source)

Undocumented