Class AirshipUserController

Provides access to user information.

Methods

  • Gets the users friends list.

    Returns Promise<Result<PublicUser[], undefined>>

    A list of friends.

  • Gets a single user by their ID.

    Parameters

    • userId: string

      The users ID

    • useLocalCache: boolean = true

      If true this function will return values cached locally. This is usually preferable unless you need to guarantee the most up-to-date results. Defaults to true.

    Returns Promise<Result<undefined | PublicUser, undefined>>

    A result with a user object. If success is true but data is undefined that means the request succeeded but no user exists with the given id.

  • Gets a single user by their username (case insensitive).

    Parameters

    • username: string

      The username of the user.

    • useLocalCache: boolean = true

      If true this function will return values cached locally. This is usually preferable unless you need to guarantee the most up-to-date results. Defaults to true.

    Returns Promise<Result<undefined | PublicUser, undefined>>

    A result with a user object. If success is true but data is undefined that means the request succeeded but no user exists with the given id.

  • Gets multiple users at once. This function will not succeed if it is unable to resolve all provided ids into a user.

    Parameters

    • userIds: string[]

      The userIds to get.

    • strict: boolean = true

      Specifies if all users must be found. If set to false, the function will succeed even if not all userIds resolve to a user.

    Returns Promise<Result<{
        array: PublicUser[];
        map: Record<string, PublicUser>;
    }, undefined>>

    An array of user objects.

  • Checks if the user is friends with the user provided.

    Parameters

    • userId: string

      The user id to check friend status with.

    Returns Promise<Result<boolean, undefined>>

    True if friends, false otherwise.