# Class: DiaryModule

A module to interact with the Genshin Impact diary endpoints of the Hoyolab API

# Table of contents

# Constructors

# Properties

# Methods

# Constructors

# constructor

new DiaryModule(request, lang, region, uid)

Constructs a DiaryModule instance

# Parameters

Name Type Description
request Request An instance of the Request class to make HTTP requests
lang LanguageEnum A LanguageEnum value for the language of the user
region null | string A string value for the region of the user
uid null | number A number value for the UID of the user

# Defined in

src/modules/diary/diary.ts:24 (opens new window)

# Properties

# lang

Private lang: LanguageEnum

A LanguageEnum value for the language of the user

# Defined in

src/modules/diary/diary.ts:26 (opens new window)


# region

Private region: null | string

A string value for the region of the user

# Defined in

src/modules/diary/diary.ts:27 (opens new window)


# request

Private request: Request

An instance of the Request class to make HTTP requests

# Defined in

src/modules/diary/diary.ts:25 (opens new window)


# uid

Private uid: null | number

A number value for the UID of the user

# Defined in

src/modules/diary/diary.ts:28 (opens new window)

# Methods

# detail

detail(type, month?): Promise<IGenshinDiaryDetail>

Returns the diary details of a given type and month for a user

Throws

HoyolabError when the uid or region parameter is missing or invalid, or when the type or month 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

Name Type Default value Description
type DiaryEnum undefined A DiaryEnum value for the type of diary details requested
month DiaryMonthEnum DiaryMonthEnum.CURRENT A DiaryMonthEnum value for the month of the diary details requested. Default is CURRENT.

# Returns

Promise<IGenshinDiaryDetail>

A promise that resolves to an IGenshinDiaryDetail object

# Defined in

src/modules/diary/diary.ts:76 (opens new window)


# diaries

diaries(month?): Promise<IGenshinDiaryInfo>

Returns the diary information of a given month for a user

Throws

HoyolabError when the uid or region parameter is missing or 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

Name Type Default value Description
month DiaryMonthEnum DiaryMonthEnum.CURRENT A DiaryMonthEnum value for the month of the diary information requested. Default is CURRENT.

# Returns

Promise<IGenshinDiaryInfo>

A promise that resolves to an IGenshinDiaryInfo object

# Defined in

src/modules/diary/diary.ts:41 (opens new window)