Skip to main content

Class: GenshinRecordModule

GenshinRecordModule class provides methods to interact with Genshin Impact's record module endpoints.

Constructors

constructor

new GenshinRecordModule(request, lang, region, uid)

Creates an instance of GenshinRecordModule.

Parameters

NameTypeDescription
requestHTTPRequestAn instance of Request class.
langLanguageEnumThe language code to be used in requests.
regionnull | stringThe server region code in which the user's account resides.
uidnull | numberThe user ID of the Genshin Impact account.

Defined in

src/client/gi/record/record.ts:37

Properties

lang

Private lang: LanguageEnum

The language code to be used in requests.

Defined in

src/client/gi/record/record.ts:39


region

Private region: null | string

The server region code in which the user's account resides.

Defined in

src/client/gi/record/record.ts:40


request

Private request: HTTPRequest

An instance of Request class.

Defined in

src/client/gi/record/record.ts:38


uid

Private uid: null | number

The user ID of the Genshin Impact account.

Defined in

src/client/gi/record/record.ts:41

Methods

characters

characters(): Promise<IGenshinCharacters>

Retrieves the Genshin characters of the user.

Async

Throws

If UID parameter is missing or failed to be filled.

Remarks

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.

Returns

Promise<IGenshinCharacters>

A Promise that contains the Genshin characters object.

Defined in

src/client/gi/record/record.ts:105


charactersSummary

charactersSummary(characterIds): Promise<IGenshinCharacterSummary>

Returns the summary information of Genshin Impact game characters.

Throws

Throws an error if the UID parameter is missing or failed to be filled.

Remarks

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.

Parameters

NameTypeDescription
characterIdsnumber[]An array of character IDs to retrieve the summary information for.

Returns

Promise<IGenshinCharacterSummary>

A Promise that resolves to an object containing the summary information of the characters.

Defined in

src/client/gi/record/record.ts:153


dailyNote

dailyNote(): Promise<IGenshinDailyNote>

Retrieve the daily note information for a Genshin Impact user.

Throws

if the UID parameter is missing or failed to be filled.

Remarks

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.

Returns

Promise<IGenshinDailyNote>

The daily note information.

Defined in

src/client/gi/record/record.ts:259


records

records(): Promise<IGenshinRecord>

Get user's Genshin Impact record

Async

Function

Throws

If UID parameter is missing or failed to be filled

Remarks

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.

Returns

Promise<IGenshinRecord>

  • User's Genshin Impact record

Defined in

src/client/gi/record/record.ts:55


spiralAbyss

spiralAbyss(scheduleType?): Promise<IGenshinSpiralAbyss>

Retrieves information about the player's performance in the Spiral Abyss.

Throws

if UID parameter is missing or failed to be filled, or if the given scheduleType parameter is invalid.

Remarks

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.

Parameters

NameTypeDefault valueDescription
scheduleTypeSpiralAbyssScheduleEnumSpiralAbyssScheduleEnum.CURRENTThe schedule type of the Abyss, either CURRENT or PREVIOUS.

Returns

Promise<IGenshinSpiralAbyss>

A Promise that resolves with an object containing the player's Spiral Abyss data.

Defined in

src/client/gi/record/record.ts:204