forked from wonjung/ircbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.rb
48 lines (42 loc) · 1.16 KB
/
run.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
require 'rubygems'
require 'cinch'
require 'sequel'
require 'ircdb'
require "cinch/plugins/identify"
require "cinch/plugins/downforeveryone"
require 'cinch-calculate'
Dir['bsdforen_plugins/factoids/*'].each { |f| require_relative f }
NICKNAME = 'analtux'
PASSWORD = ''
USERNAME = 'analtux'
REALNAME = 'Analtux NG http://bsdforen.de'
IRCNET = 'irc.freenode.org'
CHANNELS = ['#bsdforen.de']
PLUGINS = [GetRandomNumber, GetFactoid, LearnFactoid, ForgetFactoid, Cinch::Plugins::Identify, Cinch::Plugins::Calculate,
Cinch::Plugins::DownForEveryone]
class IRCBot
include Cinch::Plugin
def initialize
@bot = Cinch::Bot.new do
configure do |c|
c.plugins.plugins = PLUGINS
c.encoding = 'utf-8'
c.nick = NICKNAME
c.plugins.options[Cinch::Plugins::Identify] = {
:password => PASSWORD,
:type => :nickserv
}
c.plugins.options[Cinch::Plugins::Calculate][:units_path] = '/usr/local/bin/gunits'
c.user = USERNAME
c.realname = REALNAME
c.server = IRCNET
c.channels = CHANNELS
end
end
end
def run
@bot.start
end
end
ib = IRCBot.new
ib.run