Class: ChatSDK::X::EventParser

Inherits:
Object
  • Object
show all
Defined in:
lib/chat_sdk/x/event_parser.rb

Class Method Summary collapse

Class Method Details

.parse(payload, bot_user_id: nil) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/chat_sdk/x/event_parser.rb', line 7

def parse(payload, bot_user_id: nil)
  return [] unless payload.is_a?(Hash)

  events = []
  events.concat(parse_mentions(payload, bot_user_id))
  events.concat(parse_direct_messages(payload, bot_user_id))
  events.concat(parse_favorites(payload, bot_user_id))
  events
end