Class | IRCBot |
In: |
lib/net/yail/IRCBot.rb
|
Parent: | Object |
My abstraction from adapter to a real bot.
irc | [R] |
Creates a new bot yay. Note that due to my laziness, the options here are almost exactly the same as those in Net::YAIL. But at least there are more defaults here.
Options:
To be subclassed - this method is a nice central location to allow the bot to register its handlers before this class takes control and hits the IRC network.
Creates the socket connection and registers the (very simple) default welcome handler. Subclasses should build their hooks in add_custom_handlers to allow auto-creation in case of a restart.
Tells us the main app wants to just wait until we‘re done with all thread processing, or get a kill signal, or whatever. For now this is basically an endless loop that lets the threads do their thing until the socket dies. If a bot wants, it can handle :irc_loop to do regular processing.