Sha256: 626e1ffbfd7b25ae2c27ce3ae8038b88d8cf9db27715dfe9a011a5d9f6167961

Contents?: true

Size: 1.4 KB

Versions: 1

Compression:

Stored size: 1.4 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 /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/,
          name: 'thumbup',
          description: 'thumbup',
          reaction_only: true,
          all: true

        on /.*\z/,
          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

1 entries across 1 versions & 1 rubygems

Version Path
ruboty-slack_reaction_added-0.4.0 lib/ruboty/slack_reaction_added/handlers/handler.rb