Module: SlackRubyBot::Hooks::Message
Instance Method Summary collapse
Methods included from Base
Instance Method Details
#message(client, data) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/slack-ruby-bot/hooks/message.rb', line 6 def (client, data) data = Hashie::Mash.new(data) return if !SlackRubyBot::Config. && (client.self && client.self['id'] == data.user) data.text.strip! if data.text 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 |