Class: Twitch::Bot::CommandHandler
- Inherits:
-
EventHandler
- Object
- EventHandler
- Twitch::Bot::CommandHandler
- Defined in:
- lib/twitch/bot/command_handler.rb
Overview
Base class for implementing chat commands
Instance Attribute Summary
Attributes inherited from EventHandler
Class Method Summary collapse
Instance Method Summary collapse
-
#call ⇒ Object
FIXME: Does this have to be public only for testing?.
- #command_aliases ⇒ Object
Methods inherited from EventHandler
Constructor Details
This class inherits a constructor from Twitch::Bot::EventHandler
Class Method Details
.handled_events ⇒ Object
7 8 9 |
# File 'lib/twitch/bot/command_handler.rb', line 7 def self.handled_events [:user_message] end |
Instance Method Details
#call ⇒ Object
FIXME: Does this have to be public only for testing?
16 17 18 19 20 |
# File 'lib/twitch/bot/command_handler.rb', line 16 def call if event.command? && command_aliases.include?(event.command) handle_command end end |
#command_aliases ⇒ Object
11 12 13 |
# File 'lib/twitch/bot/command_handler.rb', line 11 def command_aliases [] end |