Polyjuice Client v0.4.2 Polyjuice.Client.Profile View Source

Profile-related functions.

Link to this section Summary

Link to this section Functions

Link to this function

get_avatar_url(client_api, user_id \\ nil)

View Source
get_avatar_url(
  client_api :: Polyjuice.Client.API.t(),
  user_id :: String.t() | nil
) :: {:ok, String.t()} | any()

Get avatar url for the user.

user_id is the ID of user whose profile should be retrieved. If user_id is ommited it defaults to the user_id represented by the client.

Link to this function

get_displayname(client_api, user_id \\ nil)

View Source
get_displayname(
  client_api :: Polyjuice.Client.API.t(),
  user_id :: String.t() | nil
) :: {:ok, String.t()} | any()

Get display name for the user.

user_id is the ID of the user whose profile should be retrieved. If user_id is ommited it defaults to the user_id represented by the client.

Link to this function

get_profile(client_api, user_id \\ nil)

View Source
get_profile(client_api :: Polyjuice.Client.API.t(), user_id :: String.t() | nil) ::
  {:ok, map()} | any()

Get user profile.

user_id is the ID of the user whose profile should be retrieved. If user_id is ommited it defaults to the user_id represented by the client.

Link to this function

put_avatar_url(client_api, user_id \\ nil, avatar_url)

View Source
put_avatar_url(
  client_api :: Polyjuice.Client.API.t(),
  user_id :: String.t() | nil,
  avatar_url :: String.t()
) :: :ok | any()

Modify avatar url for the user.

user_id is the ID of the user whose profile should be retrieved. If user_id is ommited it defaults to the user_id represented by the client. avatar_url is an mxc: URL specifying the location of the new profile avatar.

Link to this function

put_displayname(client_api, user_id \\ nil, displayname)

View Source
put_displayname(
  client_api :: Polyjuice.Client.API.t(),
  user_id :: String.t() | nil,
  displayname :: String.t()
) :: :ok | any()

Modify display name for the user.

user_id is the ID of the user whose profile should be retrieved. If user_id is ommited it defaults to the user_id represented by the client. displayname is the new displayname.