Class: MiniBot::Daemon

Inherits:
Object
  • Object
show all
Includes:
Commands, Events
Defined in:
lib/minibot/daemon.rb

Constant Summary

Constants included from Events::Constants

Events::Constants::ERR_NICKNAMEINUSE, Events::Constants::EXPECTED_REPLIES_TOPIC, Events::Constants::RPL_NOTOPIC, Events::Constants::RPL_TOPIC, Events::Constants::RPL_TOPIC_META, Events::Constants::RPL_WELCOME

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Commands

#join, #nickserv, #say, #set_nick, #set_user, #topic

Methods included from Events

#default, #error, #invited, #kicked, #message, #pinged, #private_message, #ready, #topic_changed, #user_action, #user_joined, #user_kicked, #user_parted

Instance Attribute Details

#serverObject (readonly)

Returns the value of attribute server.



8
9
10
# File 'lib/minibot/daemon.rb', line 8

def server
  @server
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/minibot/daemon.rb', line 10

def run
  begin
    connect @servername, @port
     @username, @realname
    identify @nick, @nickserv_pwd
    main_loop
  rescue Exception => e
    handle_exception(e)
    raise e
  ensure
    disconnect
  end
end