lita-irc
lita-irc is an adapter for Lita that allows you to use the robot with IRC.
Installation
Add lita-irc to your Lita instance's Gemfile:
gem "lita-irc"
Configuration
All attributes set on config.adapter
will be passed on to the underlying Cinch robot. The documentation for Cinch's options detail all of them.
The attributes listed below are either fundamental to making the bot work, or have defaults provided by Lita that take precedence over Cinch's defaults.
Required attributes
server
(String) - The name of the IRC server Lita should connect to. Default:nil
.channels
(Array) - An array of channels Lita should join upon connection. Default: nil
.
Optional attributes
user
(String) - The username for Lita's IRC account. Default: `"Lita"".password
(String) - The password for Lita's IRC account. Default:nil
.realname
(String) - The "real name" field for Lita's IRC account. Default:"Lita"
.
Lita-specific attributes
log_level
(Symbol) - Sets the log level for Cinch's loggers. By default, Cinch's loggers are disabled. Default:nil
.
Note: config.robot.name
is used as Lita's IRC nickname. config.adapter.nick
is ignored.
Example
Lita.configure do |config|
config.robot.name = "Lita"
config.robot.adapter = :irc
config.adapter.server = "irc.freenode.net"
config.adapter.channels = ["#litabot"]
config.adapter.user = "Lita"
config.adapter.realname = "Lita"
config.adapter.password = "secret"
end
Events
The IRC adapter will trigger the :connected
and :disconnected
events when the robot has connected and disconnected from IRC, respectively. There is no payload data for either event.