-
Notifications
You must be signed in to change notification settings - Fork 1
/
tachikoma.rb
executable file
·56 lines (45 loc) · 1.2 KB
/
tachikoma.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
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env ruby
# require our gems
require 'cinch'
require 'yaml'
# calculate the base dir of the application
basedir = File.expand_path(File.dirname(__FILE__))
# require our plugins
Dir[basedir+'/plugins/*.rb'].each do |plugin|
require plugin
end
# create the bot instance
bot = Cinch::Bot.new do
configure do |c|
# get the irc config
botConf = YAML.load_file(basedir+'/conf/irc.yaml')
# server config
c.server = botConf['server']['host']
c.password = botConf['server']['password']
c.port = botConf['server']['port']
c.nick = botConf['bot']['nick']
c.user = botConf['bot']['user']
c.realname = botConf['bot']['realname']
c.channels = botConf['server']['channels']
# SSL config
# @todo: properly setup certificate usage
c.ssl.use = botConf['server']['ssl']['use']
# loaded plugins
# @todo: define this in the configfiles?
c.plugins.plugins = [
# Controls,
# Info,
# Social
]
end
trap "SIGINT" do
# exit cleanly
bot.quit "Caught SIGINT"
end
trap "SIGTERM" do
# exit cleanly
bot.quit "Caught SIGTERM"
end
end
# start the bot
bot.start