Could you give me an overview of where I could find the code that sets up event collection?
I looked through the code and couldn't figure out how it's being done. I think it would be great to be able to pass in multiple events that are similar in type.
Example
SlackRubyBotServer::Events.configure do |config|
config.on :event, ['event_callback', ['pin_added', 'pin_removed']] do |event|
Right now I'm handling it like this..
SlackRubyBotServer::Events.configure do |config|
config.on :event, ['event_callback'] do |event|
event_type = event[:event][:type]
case event_type
when 'pin_added', 'pin_removed'
# Do Pin Stuff
when 'reaction_added', 'reaction_removed'
# Do Reaction Stuff
else
# Do Log & Error Handling Stuff
end
{ ok: true }
end
end
Could you give me an overview of where I could find the code that sets up event collection?
I looked through the code and couldn't figure out how it's being done. I think it would be great to be able to pass in multiple events that are similar in type.
Example
Right now I'm handling it like this..