"DTD/xhtml1-strict.dtd">
Class Irc::IrcBot
In: rbot/ircbot.rb
Parent: Object
Class: JoinMessage Class: PartMessage Class: Plugins Class: KickMessage Class: IrcAuth Class: IRCChannel Class: IrcSocket Class: BotConfig Class: Keywords Class: BotRegistryAccessor Class: IrcClient Class: DBHash Class: Language Class: TopicMessage Class: QuitMessage Class: PrivMessage Class: UserMessage Class: NoticeMessage Class: IrcBot Class: BasicUserMessage Class: NickMessage Class: Plugin Class: BotRegistry Class: Keyword Class: DBTree Module: Irc

Main bot class, which receives messages, handles them or passes them to plugins, and stores runtime data

Methods
action    connect    corehelp    delegate_privmsg    help    join    log    log_sent    mainloop    new    nickchg    notice    okay    onjoin    onkick    onpart    onprivmsg    part    quit    rescan    save    say    sendmsg    sendq    status    topic   
Attributes
:addressing_prefixes  [R] 

bot's configured addressing prefixes

:auth  [R] 

the bot's IrcAuth data

:botclass  [R] 

the botclass for this bot (determines configdir among other things)

:channels  [R] 

channel info for channels the bot is in

:config  [R] 

the bot's BotConfig data

:lang  [R] 

bot's Language data

:nick  [R] 

the bot's current nickname

:registry  [R] 

bot's object registry, plugins get an interface to this for persistant storage (hash interface tied to a bdb file, plugins use Accessors to store and restore objects in their own namespaces.)

:timer  [R] 

used to perform actions periodically (saves configuration once per minute by default)

Public Class methods
new(botclass)

create a new IrcBot with botclass botclass

Public Instance methods
connect()

connect the bot to IRC

mainloop()

begin event handling loop

sendmsg(type, where, message)
type:message type
where:message target
message:message text

send message message of type type to target where Type can be PRIVMSG, NOTICE, etc, but those you should really use the relevant say() or notice() methods. This one should be used for IRCd extensions you want to use in modules.

sendq(message="")
notice(where, message)

send a notice message to channel/nick where

say(where, message)

say something (PRIVMSG) to channel/nick where

action(where, message)

perform a CTCP action with message message to channel/nick where

okay(where)

quick way to say "okay" (or equivalent) to where

log(message, where="server")

log message message to a file determined by where. where can be a channel name, or a nick for private message logging

topic(where, topic)

set topic of channel where to topic

quit(message=nil)
message:optional IRC quit message

quit IRC, shutdown the bot

save()

call the save method for bot's config, keywords, auth and all plugins

rescan()

call the rescan method for the bot's lang, keywords and all plugins

join(channel, key=nil)
channel:channel to join
key:optional channel key if channel is +s

join a channel

part(channel, message="")

part a channel

nickchg(name)

attempt to change bot's nick to name

help(topic=nil)
m:message asking for help
topic:optional topic help is requested for

respond to online help requests

Private Instance methods
corehelp(topic="")

handle help requests for "core" topics

onprivmsg(m)

handle incoming IRC PRIVMSG m

log_sent(type, where, message)

log a message. Internal use only.

onjoin(m)
onpart(m)
onkick(m)

respond to being kicked from a channel

status()
delegate_privmsg(message)

delegate a privmsg to auth, keyword or plugin handlers