Class RedeemModuleInternal

Class representing the Redeem module for Genshin Impact's Hoyolab API.

Constructors

Methods

Constructors

  • Constructs a new RedeemModule object.

    Parameters

    • request: HTTPRequest

      The Request object used for making HTTP requests.

    • lang: LanguageEnum

      The language to use for the API response.

    • game: GamesEnum

      The game to redeem the code for.

    • region: null | string

      The region of the user's account. If null, the API will use the default region for the game.

    • uid: null | number

      The user ID of the account. If null, the API will use the user ID associated with the provided auth cookies.

    Returns RedeemModule

Methods

  • Redeems a code for a specific game and account.

    Parameters

    • code: string

      The code to redeem.

    Returns Promise<IRedeemCode>

    A promise that resolves to an IRedeemCode object containing information about the redemption status.

    NodeHoyoError if the API returns an error.

    This method sends a request to the Genshin Impact API to get the daily note information for a user. The user's region and UID must be set before calling this method, otherwise an error will be thrown.