Class: Hipbot::Bot
- Inherits:
-
Object
- Object
- Hipbot::Bot
- Extended by:
- Reactable
- Includes:
- Adapter, Configurable, Matchable, Singleton
- Defined in:
- lib/hipbot/bot.rb
Instance Attribute Summary
Attributes included from Configurable
Attributes included from Adapter
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Reactable
default, desc, on, on_presence, scope
Methods included from Cache
Methods included from Matchable
#react, #react_to_presence, #reactions
Methods included from Configurable
Methods included from Adapter
#invite_to_room, #join_room, #kick_from_room, #leave_room, #restart!, #send_to_room, #send_to_user, #set_presence, #set_topic, #start!
Class Method Details
.on_exception(&block) ⇒ Object
44 45 46 |
# File 'lib/hipbot/bot.rb', line 44 def on_exception &block instance.configuration.exception_handler = block end |
.on_preload(&block) ⇒ Object
40 41 42 |
# File 'lib/hipbot/bot.rb', line 40 def on_preload &block instance.configuration.preloader = block end |
.start! ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/hipbot/bot.rb', line 48 def start! ::EM.error_handler(&instance.configuration.exception_handler) ::EM.run do instance.setup begin instance.start! rescue Exception => e instance_exec(e, &instance.configuration.exception_handler) end end end |