VRChat.Notifications (vrchat v1.20.0)

View Source

API calls for all endpoints tagged Notifications.

Summary

Functions

Accept Friend Request Accept a friend request by notification frq_ ID. Friend requests can be found using the NotificationsAPI getNotifications by filtering of type friendRequest.

Clear All Notifications Clear all notifications.

Delete Notification Delete a notification.

Show notification Get a notification by notification not_ ID.

List Notifications Retrieve all of the current user's notifications.

Mark Notification As Read Mark a notification as seen.

Functions

accept_friend_request(connection, notification_id, opts \\ [])

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

Accept Friend Request Accept a friend request by notification frq_ ID. Friend requests can be found using the NotificationsAPI getNotifications by filtering of type friendRequest.

Parameters

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

Returns

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

clear_notifications(connection, opts \\ [])

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

Clear All Notifications Clear all notifications.

Parameters

  • connection (VRChat.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

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

delete_notification(connection, notification_id, opts \\ [])

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

Delete Notification Delete a notification.

Parameters

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

Returns

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

get_notification(connection, notification_id, opts \\ [])

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

Show notification Get a notification by notification not_ ID.

Parameters

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

Returns

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

get_notifications(connection, opts \\ [])

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

List Notifications Retrieve all of the current user's notifications.

Parameters

  • connection (VRChat.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :type (String.t): Only send notifications of this type (can use all for all). This parameter no longer does anything, and is deprecated.
    • :sent (boolean()): Return notifications sent by the user. Must be false or omitted.
    • :hidden (boolean()): Whether to return hidden or non-hidden notifications. True only allowed on type friendRequest.
    • :after (String.t): Only return notifications sent after this Date. Ignored if type is friendRequest.
    • :n (integer()): The number of objects to return.
    • :offset (integer()): A zero-based offset from the default object sorting from where search results start.

Returns

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

mark_notification_as_read(connection, notification_id, opts \\ [])

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

Mark Notification As Read Mark a notification as seen.

Parameters

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

Returns

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