Module: Ruboty::Action::ReactionAddedAction

Included in:
Ruboty::Action
Defined in:
lib/ruboty/slack_reaction_added/extension/action.rb

Instance Method Summary collapse

Instance Method Details

#allow_reaction?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/ruboty/slack_reaction_added/extension/action.rb', line 17

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

#call(handler, message, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/ruboty/slack_reaction_added/extension/action.rb', line 4

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

#reaction_only?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/ruboty/slack_reaction_added/extension/action.rb', line 21

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