Class: SlackRubyBot::Hooks::Message
- Inherits:
-
Object
- Object
- SlackRubyBot::Hooks::Message
- Defined in:
- lib/slack-ruby-bot/hooks/message.rb
Instance Method Summary collapse
Instance Method Details
#call(client, data) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/slack-ruby-bot/hooks/message.rb', line 6 def call(client, data) return if !client. && client.(data) return if !client. && client.(data) prepare!(data) result = child_command_classes.detect { |d| d.invoke(client, data) } result ||= built_in_command_classes.detect { |d| d.invoke(client, data) } result ||= SlackRubyBot::Commands::Unknown.tap { |d| d.invoke(client, data) } result end |