Module: Legion::Extensions::MicrosoftTeams::Runners::Presence
- Includes:
- Helpers::Lex, Helpers::Client
- Included in:
- Client
- Defined in:
- lib/legion/extensions/microsoft_teams/runners/presence.rb
Instance Method Summary collapse
Methods included from Helpers::Client
#bot_connection, #graph_connection, #oauth_connection, #user_path
Instance Method Details
#get_presence(user_id: 'me') ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/legion/extensions/microsoft_teams/runners/presence.rb', line 12 def get_presence(user_id: 'me', **) conn = graph_connection(**) response = conn.get("#{user_path(user_id)}/presence") body = response.body || {} { availability: body['availability'], activity: body['activity'], fetched_at: Time.now.utc } rescue StandardError => e { availability: 'Offline', activity: 'OffWork', error: e., fetched_at: Time.now.utc } end |