diff options
Diffstat (limited to 'src/constants.ts')
-rw-r--r-- | src/constants.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/constants.ts b/src/constants.ts index 1371250..14254ed 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -120,6 +120,9 @@ async function editFile(file: GithubFile, message: string, newContent: string): } ) const data = await r.json() as any + if (!data.content?.path) + // failed to set the data, probably ratelimited or something + return fileCache.set(file.path, { path: data.content.path, content: newContent, @@ -254,6 +257,17 @@ export async function addHarpSongs(addingSongs: string[]): Promise<void> { } +/** Fetch all the known crops (used in farming contests) as an array of strings */ +export async function fetchCrops(): Promise<string[]> { + return await constants.fetchJSONConstant('crops.json') +} + +/** Add crop names (used in farming contests) to skyblock-constants. This has caching so it's fine to call many times */ +export async function addCrops(addingCrops: string[]): Promise<void> { + await constants.addJSONConstants('crops.json', addingCrops, 'crop') +} + + interface constantValues { max_minions?: number max_fairy_souls?: number |