This file looks large and may slow your browser down if we attempt
to syntax highlight it, so we are showing it without any
pretty colors.
Highlight
it anyway.
| 1 |
|
| 2 |
== Install |
| 3 |
|
| 4 |
gem install rif |
| 5 |
|
| 6 |
|
| 7 |
== Example |
| 8 |
|
| 9 |
require 'rubygems' |
| 10 |
gem 'rif' |
| 11 |
|
| 12 |
require 'rif/bot' |
| 13 |
|
| 14 |
class Bot < RIF::Bot |
| 15 |
def on_endofmotd(event) |
| 16 |
join("#flood") |
| 17 |
end |
| 18 |
def do_foo(event, args) |
| 19 |
send_message(event.from, "bar") |
| 20 |
end |
| 21 |
end |
| 22 |
|
| 23 |
bot = Bot.new("bot", "irc.freenode.net", 6667, "RIF Bot") |
| 24 |
bot.connect |