Sha256: ac9eabcf27075b38696c9b6b9c18cc87ad1ccc994cc6703bdf6f18baf77618e6

Contents?: true

Size: 528 Bytes

Versions: 17

Compression:

Stored size: 528 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
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
slack-smart-bot-1.14.2 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.14.1 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.14.0 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.13.2 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.13.1 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.13.0 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.12.9 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.12.8 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.12.7 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.12.6 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.12.5 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.12.4 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.12.3 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.12.2 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.12.1 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.12.0 lib/slack/smart-bot/comm/get_presence.rb
slack-smart-bot-1.11.0 lib/slack/smart-bot/comm/get_presence.rb