-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnerdbot.rb
43 lines (37 loc) · 1020 Bytes
/
nerdbot.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
43
require 'open-uri'
require 'cinch'
require 'json'
require 'yaml'
require_relative 'plugins/moin'
require_relative 'plugins/seen'
require_relative 'plugins/yourls'
require_relative 'plugins/channel_record'
require_relative 'plugins/help'
bot = Cinch::Bot.new do
configure do |c|
config = YAML.load_file("config.yml")
config["config"].each { |key, value| instance_variable_set("@#{key}", value) }
c.server = @server
c.nick = @nick
c.password = @password
c.channels = ["#nerderrhein"]
c.plugins.plugins = [Cinch::Yourls, Cinch::Moin, Cinch::Seen, Cinch::ChannelRecord, Cinch::Help]
c.plugins.options[Cinch::Yourls] = {
:yourlsserver => @yourlsserver,
:yourlssig => @yourlssig
}
c.plugins.options[Cinch::ChannelRecord] = {
:file => @record_file
}
c.plugins.options[Cinch::Seen] = {
:file => @seen_file
}
c.plugins.options[Cinch::Help] = {
:intro => "%s at your service."
}
end
trap "SIGINT" do
bot.quit
end
end
bot.start