VRChat.Friends (vrchat v1.20.0)

View Source

API calls for all endpoints tagged Friends.

Summary

Functions

Delete Friend Request Deletes an outgoing pending friend request to another user. To delete an incoming friend request, use the deleteNotification endpoint instead.

Send Friend Request Send a friend request to another user.

Check Friend Status Retrieve if the user is currently a friend with a given user, if they have an outgoing friend request, and if they have an incoming friend request. The proper way to receive and accept friend request is by checking if the user has an incoming Notification of type friendRequest, and then accepting that notification.

List Friends List information about friends.

Unfriend Unfriend a user by ID.

Functions

delete_friend_request(connection, user_id, opts \\ [])

@spec delete_friend_request(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, VRChat.Model.Success.t()}
  | {:ok, VRChat.Model.Error.t()}
  | {:error, Tesla.Env.t()}

Delete Friend Request Deletes an outgoing pending friend request to another user. To delete an incoming friend request, use the deleteNotification endpoint instead.

Parameters

  • connection (VRChat.Connection): Connection to server
  • user_id (String.t): Must be a valid user ID.
  • opts (keyword): Optional parameters

Returns

  • {:ok, VRChat.Model.Success.t} on success
  • {:error, Tesla.Env.t} on failure

friend(connection, user_id, opts \\ [])

@spec friend(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, VRChat.Model.Notification.t()}
  | {:ok, VRChat.Model.Error.t()}
  | {:error, Tesla.Env.t()}

Send Friend Request Send a friend request to another user.

Parameters

  • connection (VRChat.Connection): Connection to server
  • user_id (String.t): Must be a valid user ID.
  • opts (keyword): Optional parameters

Returns

  • {:ok, VRChat.Model.Notification.t} on success
  • {:error, Tesla.Env.t} on failure

get_friend_status(connection, user_id, opts \\ [])

@spec get_friend_status(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, VRChat.Model.FriendStatus.t()}
  | {:ok, VRChat.Model.Error.t()}
  | {:error, Tesla.Env.t()}

Check Friend Status Retrieve if the user is currently a friend with a given user, if they have an outgoing friend request, and if they have an incoming friend request. The proper way to receive and accept friend request is by checking if the user has an incoming Notification of type friendRequest, and then accepting that notification.

Parameters

  • connection (VRChat.Connection): Connection to server
  • user_id (String.t): Must be a valid user ID.
  • opts (keyword): Optional parameters

Returns

  • {:ok, VRChat.Model.FriendStatus.t} on success
  • {:error, Tesla.Env.t} on failure

get_friends(connection, opts \\ [])

@spec get_friends(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, [VRChat.Model.LimitedUserFriend.t()]}
  | {:ok, VRChat.Model.Error.t()}
  | {:error, Tesla.Env.t()}

List Friends List information about friends.

Parameters

  • connection (VRChat.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :offset (integer()): A zero-based offset from the default object sorting from where search results start.
    • :n (integer()): The number of objects to return.
    • :offline (boolean()): Returns only offline users if true, returns only online and active users if false

Returns

  • {:ok, [%LimitedUserFriend{}, ...]} on success
  • {:error, Tesla.Env.t} on failure

unfriend(connection, user_id, opts \\ [])

@spec unfriend(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, VRChat.Model.Success.t()}
  | {:ok, VRChat.Model.Error.t()}
  | {:error, Tesla.Env.t()}

Unfriend Unfriend a user by ID.

Parameters

  • connection (VRChat.Connection): Connection to server
  • user_id (String.t): Must be a valid user ID.
  • opts (keyword): Optional parameters

Returns

  • {:ok, VRChat.Model.Success.t} on success
  • {:error, Tesla.Env.t} on failure