-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.rb
42 lines (34 loc) · 938 Bytes
/
bot.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
require "cinch"
require "cinch/plugins/memo"
require "cinch/plugins/last_seen"
require "cinch/plugins/fortune"
require "net/http"
require "httparty"
require "sinatra"
require File.expand_path('../plugins/ping', __FILE__)
require File.expand_path('../plugins/meetup', __FILE__)
Cinch::Plugins::Memo::Base.configure do |c|
c.store = :redis # data store
c.host = 'localhost' # your host
c.port = '6379' # your port
end
$bot = Cinch::Bot.new do
configure do |c|
c.server = "irc.freenode.net"
c.nick = "ocruby"
c.channels = ["#ocruby"]
c.plugins.plugins = [
Cinch::Plugins::Memo::Base,
Cinch::Plugins::LastSeen::Base,
Cinch::Plugins::Fortune,
Cinch::Plugins::Ping,
Cinch::Plugins::Meetup
]
end
end
Thread.new do
$bot.start
end
get '/say/:word' do
$bot.Channel('#ocruby').send "You said #{params[:word]}"
end