Sha256: aeff8e412896c1610369cb12efa4d9cbc12860445d9d04d4a2a3a621a09f4375
Contents?: true
Size: 682 Bytes
Versions: 2
Compression:
Stored size: 682 Bytes
Contents
# frozen_string_literal: true module MessageListener def self.call(schema:, raw_data:) # Do some cool(quick returning) things here # schema.payload.event will be a SlackBot::Events::Schemas::Type::Message puts "Heya! I found a message! #{schema.payload.event.text}" raise StandardError, "I Randomly decided to Barf" if rand > 0.9 end def self.on_success(schema) # Send a metric maybe? # Or a Log Message puts "Congrats! You executed it succesfully" end def self.on_failure(schema, error) # Send job to sidekiq to try again? # Or send a log message; but make sure to do it quick puts "Yikes, You died a misreable death" end end
Version data entries
2 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
slack_bot-events-0.4.4 | examples/basic/message_listener.rb |
slack_bot-events-0.4.4 | examples/middleware/message_listener.rb |