Class GenshinImpact

The Genshin class provides an interface to interact with Genshin Impact-related features on the Mihoyo website. It contains references to various modules such as DailyModule, RedeemModule, GenshinRecordModule, and GenshinDiaryModule which allow you to perform various operations related to these features.

Constructors

Properties

cookie: ICookie

The cookie object to be used in requests.

The DailyModule object provides an interface to interact with the daily check-in feature in Genshin Impact.

The GenshinDiaryModule object provides an interface to interact with the user diary feature in Genshin Impact.

The GenshinRecordModule object provides an interface to interact with the user record feature in Genshin Impact.

redeem: RedeemModule

The RedeemModule object provides an interface to interact with the code redemption feature in Genshin Impact.

region: null | string

The region of the user, if available.

The GenshinTCGModule object provides an interface to interact with the user diary feature in Genshin Impact.

uid: null | number

The UID of the user, if available.

Accessors

  • get account(): null | IGame
  • Getter for the account property.

    Returns null | IGame

    The current value of the account property.

  • set account(game): void
  • Setter for the account property. Prevents from changing the value once set

    Parameters

    • game: null | IGame

      The game object to set as the account.

    Returns void

Methods

  • Create a new instance of the GenshinImpact class asynchronously.

    Parameters

    Returns Promise<GenshinImpact>

    A promise that resolves with a new Genshin instance.

    Error Wnen the CookieTokenV2 is not set.

    If an object is instantiated from this method but options.cookie.cookieTokenV2 is not set, it will throw an error. This method will access an Endpoint that contains a list of game accounts, which requires the cookieTokenV2 option.