Sha256: ef055c5f70e48a8d80ba2bc2f232248d98212f4591d2039ec605ed5772bb0a35

Contents?: true

Size: 784 Bytes

Versions: 2

Compression:

Stored size: 784 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)
    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: Thread.current[:dest], name: emoji, timestamp: ts) unless config.simulate
      rescue Exception => stack
        @logger.warn stack
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
slack-smart-bot-1.9.2 lib/slack/smart-bot/comm/unreact.rb
slack-smart-bot-1.9.1 lib/slack/smart-bot/comm/unreact.rb