Ex.Pnut v0.1.0 ExPnut.User.Presence View Source

A user's presence is the recent status of that user. Each updated presence lasts for 15 minutes, or until another status is given. Users who do not have a current status show up as "offline".

A user's status can be updated on any authenticated call by simply including the update_presence query parameter with a status for its value. If this method is attempted, the response's meta.updated_presence key will be set and true. If it fails to update, it will be false.

Endpoints:

  • Get present users
  • Get a user's presence
  • Update the authenticated user's presence

https://pnut.io/docs/api/resources/users/presence

Link to this section Summary

Link to this section Functions

Link to this function

get_presence(client, user_params \\ %UserParams{}) View Source

Retrieve all users' presence statuses that are not "offline".

Link to this function

get_user_presence(client, user_id, user_params \\ %UserParams{}) View Source

Retrieve a user's presence.

If the user has never set a presence, "last_seen_at" will not be set.

Link to this function

set_presence(client, presence, user_params \\ %UserParams{}) View Source

Update a user's presence.

If the "update_presence" query parameter is set on this call, it will override this call. It will not occur twice.

NameDescription
presenceA string up to 100 unicode characters. If not set, or if it is set to 1, it will be updated to "online". A value of "offline" or 0 will delete the user's presence and remove them from the list of users online.