Sha256: 652fe188eda93528b5bac7471428bb14764eeaea7ec5a4c9e5a13f55202f7bda

Contents?: true

Size: 1.41 KB

Versions: 2

Compression:

Stored size: 1.41 KB

Contents

require 'ruboty/slack_reaction_added/actions/permalink.rb'
require 'ruboty/slack_reaction_added/actions/reaction_name.rb'
require 'ruboty/slack_reaction_added/actions/reaction_ping.rb'
require 'ruboty/slack_reaction_added/actions/thumbup.rb'

module Ruboty
  module SlackReactionAdded
    module Handlers
      class Handler < Ruboty::Handlers::Base

        on /reaction ping\z/,
          name: 'reaction_able_ping',
          description: 'ping allow reaction',
          allow_reaction: true

        on /reaction name\z/,
          name: 'reaction_name',
          description: 'reaction name say on readciont_added',
          reaction_only: true

        on /.*\z/m,
          name: 'thumbup',
          description: 'thumbup',
          reaction_only: true,
          all: true

        on /.*\z/m,
          name: 'permalink',
          description: 'permalink',
          reaction_only: true,
          all: true

        def reaction_able_ping(message)
          Ruboty::SlackReactionAdded::Actions::ReactionPing.new(message).call
        end

        def reaction_name(message)
          Ruboty::SlackReactionAdded::Actions::ReactionName.new(message).call
        end

        def thumbup(message)
          Ruboty::SlackReactionAdded::Actions::Thumbup.new(message).call
        end

        def permalink(message)
          Ruboty::SlackReactionAdded::Actions::Permalink.new(message).call
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruboty-slack_reaction_added-0.6.0 lib/ruboty/slack_reaction_added/handlers/handler.rb
ruboty-slack_reaction_added-0.5.0 lib/ruboty/slack_reaction_added/handlers/handler.rb