Class Irc::Bot
In: lib/rbot/botuser.rb
lib/rbot/config.rb
lib/rbot/ircbot.rb
lib/rbot/language.rb
lib/rbot/message.rb
lib/rbot/messagemapper.rb
lib/rbot/plugins.rb
lib/rbot/rbotconfig.rb
lib/rbot/registry.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

Classes and Modules

Module Irc::Bot::Auth
Module Irc::Bot::Config
Module Irc::Bot::Plugins
Class Irc::Bot::Language
Class Irc::Bot::MessageMapper
Class Irc::Bot::MessageParameter
Class Irc::Bot::MessageTemplate
Class Irc::Bot::Registry

Constants

COPYRIGHT_NOTICE = "(c) Tom Gilbert and the rbot development team"
SOURCE_URL = "http://ruby-rbot.org"

Attributes

auth  [R]  the bot‘s Auth data
botclass  [R]  the botclass for this bot (determines configdir among other things)
config  [R]  the bot‘s Config data
httputil  [RW]  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
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.)
save_mutex  [R]  synchronize with this mutex while touching permanent data files: saving, flushing, cleaning up …
socket  [R]  bot‘s irc socket TODO multiserver
timer  [R]  used to perform actions periodically (saves configuration once per minute by default)

Public Class methods

create a new Bot with botclass botclass

Public Instance methods

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

connect the bot to IRC

things to do when we receive a signal

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

respond to online help requests

bot inspection TODO multiserver

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

join a channel

begin event handling loop

bot User in the client/server connection TODO multiserver

bot User in the client/server connection

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

We want to respond to a hung server in a timely manner. If nothing was received in the user-selected timeout and we haven‘t PINGed the server yet, we PING the server. If the PONG is not received within the user-defined timeout, we assume we‘re in ping timeout and act accordingly.

checks if we should be quiet on a channel

message:optional IRC quit message

quit IRC, shutdown the bot

call the rescan method for all of the botmodules

totally shutdown and respawn the bot

call the save method for all of the botmodules

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

server we are connected to TODO multiserver

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 can also be used to retrieve the topic of channel where by omitting the last argument

trap signals

nick wanted by the bot. This defaults to the irc.nick config value, but may be overridden by a manual !nick command

set the nick wanted by the bot

[Validate]