Sha256: 9b1baddcdf582fa690dd11a40ca5edf75e6105770d7f94ae4b0da630a513f7fe

Contents?: true

Size: 919 Bytes

Versions: 3

Compression:

Stored size: 919 Bytes

Contents

class SlackSmartBot
  # list of available emojis: https://www.webfx.com/tools/emoji-cheat-sheet/
  # unreact(:thumbsup)
  # ts: can be true, false or a specific ts
  def unreact(emoji, ts=false, channel: Thread.current[:dest])
    begin
      if ts.is_a?(TrueClass) or ts.is_a?(FalseClass)
        parent = ts
        ts = nil
      else
        parent = false
      end
      if ts.nil?
        if parent or Thread.current[:ts].to_s == ''
          ts = Thread.current[:thread_ts]
        else
          ts = Thread.current[:ts]
        end
      end
      if ts.nil?
        @logger.warn 'unreact method no ts supplied'
      else
        begin
          client.web_client.reactions_remove(channel: channel, name: emoji, timestamp: ts) unless config.simulate
        rescue Exception => stack
          @logger.warn stack
        end
      end
    rescue Exception => stack
      @logger.warn stack
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
slack-smart-bot-1.15.25 lib/slack/smart-bot/comm/unreact.rb
slack-smart-bot-1.15.1 lib/slack/smart-bot/comm/unreact.rb
slack-smart-bot-1.15.0 lib/slack/smart-bot/comm/unreact.rb