Sha256: 7f12ae54b97ba65d26d1144f6cda173aafec772aac186f2e0efb76199d1315e1

Contents?: true

Size: 563 Bytes

Versions: 3

Compression:

Stored size: 563 Bytes

Contents

class SlackSmartBot

  def get_presence(user)
    begin
      if user.to_s.length>0
        if config.simulate and config.key?(:client)
          if user[0]=='@' #name
            client.web_client.users_get_presence.select{|k, v| v[:name] == user[1..-1]}.values[-1]
          else #id
            client.web_client.users_get_presence[user.to_sym]
          end
        else
          client.web_client.users_getPresence(user: user)
        end
      end
    rescue Exception => stack
      @logger.warn stack
      return {presence: "unknown"}
    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/get_presence.rb
slack-smart-bot-1.15.1 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.15.0 lib/slack/smart-bot/comm/get_presence.rb