No commit activity in last 3 years
No release in over 3 years
repp-heartful_slack is a powerful handler of Repp for Slack.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.17
~> 10.0
= 0.78.0
~> 3.3

Runtime

 Project Readme

repp-heartful_slack

repp-heartful_slack is a powerful handler of Repp for Slack.

Installation

Add this line to your application's Gemfile:

gem 'repp-heartful_slack'

And then execute:

$ bundle

Or install it yourself as:

$ gem install repp-heartful_slack

Usage

in Mobb

require 'mobb'
require 'repp/heartful_slack'

set :service, 'heartful_slack'

set :on_message do |_|
  condition {@env.kind_of?(::Repp::HeartfulSlack::MessageReceive)}
end

set :on_event do |_|
  condition {@env.kind_of?(::Repp::HeartfulSlack::EventReceive)}
end

set :to_notify do |_|
  dest_condition do |res|
    res.last[:channel] = ENV['NOTIFY_CHANNEL'] # ex. Cxxxxxxx
  end
end

on 'emoji_changed', on_event: true, to_notify: true do
  case @env.raw.subtype
  when 'add'
    "new emoji -> :#{@env.raw.name}:"
  when 'remove'
    "removed emoji -> #{@env.raw.names.map { |name| ":#{name}:" }.join(' ')}"
  end
end

see sample/app.rb

License

The gem is available as open source under the terms of the MIT License.