11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/irc-qik-bot.rb', line 11
def self.chat(irc_svr = nil, irc_chanl = nil, irc_nick = nil)
begin
if irc_svr.nil?
cnf = IRC::Motor.ymlconf["network"]["default"]
irc_svr = cnf["server"]
irc_chanl = cnf["channel"]
irc_nick = cnf["nick"]
elsif irc_chanl.nil?
cnf = IRC::Motor.ymlconf["network"][irc_svr]["default"]
irc_chanl = cnf["channel"]
irc_nick = cnf["nick"]
elsif irc_nick.nil?
irc_nick = IRC::Motor.ymlconf["network"][irc_svr][irc_chanl]["nick"]
end
IRC::Motor.connect irc_svr
IRC::Motor.join_channel irc_chanl, irc_nick
IRC::Motor.in_channel
rescue
puts "\n\n\n\nOUCH!!!\n\n\n"
end
end
|