-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.rb
executable file
·53 lines (44 loc) · 1023 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
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env ruby
### configure the bot here ###
NICK = 'Erstsemester'
NAME = 'Neuling'
CHANNEL = '##cs-studs'
ADMPASS = ''
NICKAUTH = ''
HOST = 'irc.freenode.net'
PORT = 6666
LOG = true
LOGDIR = 'log/'
DEBUG = false #true
=begin
#Twitter oAuth
TWITTER_TO = '@fgraum'
YOUR_CONSUMER_KEY = 'kOVgSUKQZBe65zpAs6Mw'
YOUR_CONSUMER_SECRET = '2kMQ6vkw2ApyvOWUnPrCcJvuKJM5NQhiKPGZgNdPsH0'
YOUR_OAUTH_TOKEN = '2kMQ6vkw2AyvOWUnPrCcJvuKJM5NQhiKPGZgNdPsH0'
YOUR_OAUTH_TOKEN_SECRET = 'flW2DqbRH5FnYJrjdajzk9veX1qM7c9PqUCbs1TlNM'
=end
### end config ###
#require 'twitter'
#require 'socket'
require 'time'
require 'kconv'
require 'ircclient'
require 'commands'
require 'logwriter'
#
# Checking if logdir exists and creating if not
#
if LOG && !File.directory?(LOGDIR)
Dir.mkdir(File.join(Dir.pwd, LOGDIR), 0644)
end
a = Thread.new {
client = IrcClient.new(NICK, CHANNEL, HOST, PORT, LOGDIR)
client.nickauth = NICKAUTH unless NICKAUTH.nil?
client.connect
}
begin
a.join
rescue Interrupt
print "Going down."
end