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   got_sig   help   irclog   join   log_sent   mainloop   mode   new   nickchg   notice   okay   onjoin   onkick   onpart   onprivmsg   ontopic   part   quit   rescan   restart   save   say   sendmsg   sendq   shutdown   start_server_pings   status   stop_server_pings   topic  

Classes and Modules

Module Irc::IrcBot::STDERR
Module Irc::IrcBot::STDOUT

Attributes

auth  [R]  the bot’s IrcAuth data
botclass  [R]  the botclass for this bot (determines configdir among other things)
capabilities  [R]  capabilities info for the server
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
plugins  [R]  bot’s plugins. This is an instance of class Plugins
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

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

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

join a channel

begin event handling loop

attempt to change bot’s nick to name

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 and all plugins

totally shutdown and respawn the bot

call the save method for bot’s config, 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

we’ll ping the server every 30 seconds or so, and expect a response before the next one come around..

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 or plugin handlers

log a message. Internal use only.

respond to being kicked from a channel

handle incoming IRC PRIVMSG m

[Validate]