Sha256: d04fdca4c4555dc4509e53c4be49fef50a725d226760cfd5abe77540f021a0a2

Contents?: true

Size: 606 Bytes

Versions: 6

Compression:

Stored size: 606 Bytes

Contents

module Ruboty
  class Action
    module ReactionAddedAction
      def call(handler, message, options = {})
        if message.reaction
          if allow_reaction? || reaction_only?
            # Ruboty.logger.info "reaction"
            super(handler, message, options)
          end
        else
          unless reaction_only?
            super(handler, message, options)
          end
        end
      end

      def allow_reaction?
        !!@options[:allow_reaction]
      end

      def reaction_only?
        !!@options[:reaction_only]
      end
    end

    prepend ReactionAddedAction
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruboty-slack_reaction_added-0.6.0 lib/ruboty/slack_reaction_added/extension/action.rb
ruboty-slack_reaction_added-0.5.0 lib/ruboty/slack_reaction_added/extension/action.rb
ruboty-slack_reaction_added-0.4.0 lib/ruboty/slack_reaction_added/extension/action.rb
ruboty-slack_reaction_added-0.3.0 lib/ruboty/slack_reaction_added/extension/action.rb
ruboty-slack_reaction_added-0.2.0 lib/ruboty/slack_reaction_added/extension/action.rb
ruboty-slack_reaction_added-0.1.0 lib/ruboty/slack_reaction_added/extension/action.rb