Class Irc::IrcBot
In: lib/rbot/ircbot.rb
Parent: Object

Main bot class, which manages the various components, receives messages, handles them or passes them to plugins, and contains core functionality.

Methods

action   connect   corehelp   delegate_privmsg   help   join   log   log_sent   mainloop   mode   new   nickchg   notice   okay   onjoin   onkick   onpart   onprivmsg   ontopic   part   quit   rescan   restart   save   say   sendmsg   sendq   shutdown   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
httputil  [R]  bot’s httputil help object, for fetching resources via http. Sets up proxies etc as defined by the bot configuration/environment
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.)
socket  [R]  bot’s irc socket
timer  [R]  used to perform actions periodically (saves configuration once per minute by default)

Public Class methods

create a new IrcBot with botclass botclass

Public Instance methods

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

connect the bot to IRC

m:message asking for help
topic:optional topic help is requested for

respond to online help requests

channel:channel to join
key:optional channel key if channel is +s

join a channel

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

begin event handling loop

attempt to change bot’s nick to name FIXME if rbot is already taken, this happens:

  <giblet> rbot_, nick rbot
  --- rbot_ is now known as rbot__

he should of course just keep his existing nick and report the error :P

send a notice message to channel/nick where

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

message:optional IRC quit message

quit IRC, shutdown the bot

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

totally shutdown and respawn the bot

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

say something (PRIVMSG) to channel/nick where

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.

queue an arbitraty message for the server

disconnect from the server and cleanup all plugins and modules

returns a string describing the current status of the bot (uptime etc)

set topic of channel where to topic

Private Instance methods

handle help requests for "core" topics

delegate a privmsg to auth, keyword or plugin handlers

log a message. Internal use only.

respond to being kicked from a channel

handle incoming IRC PRIVMSG m

[Validate]