💾AssetsUpdater

AssetsUpdater - a class that auto updates assets data and localization that are used inside EnkaNetwork

languages

Array of languages with localization

Full list of supported languages - EN, RU, CHS, CHT, DE, ES, FR, ID, JP, KR, PT, TH, VI

const enka = new EnkaNetwork({
    language: "EN", // This value is automatically included in the array
    assets: {
        languages: ["RU", "FR"], // This array already contains EN
    },
});

checkInterval

The interval for checking the relevance of assets in milliseconds. Default is 30 * 60 * 1000 (half hour)

const enka = new EnkaNetwork({
    assets: {
        checkInterval: 10 * 60 * 1000, // 10 minutes
    },
});

instant

Check immediately for the first time (a less convenient analogue of fetchAssets)

const enka = new EnkaNetwork({
    assets: {
        instant: true,
    },
});

fetchAssets()

Async function that checks the relevance of assets data and localization

import { EnkaNetwork } from "enkanetwork"; // ES style which I will use in the future

const enka = new EnkaNetwork(); // English is the default language

await enka.assetsUpdater.fetchAssets(); // We are waiting for checking the relevance/updating of the data. If the language did not exist in assets, it will be downloaded.

enka.fetchUser(700832641).then(console.log); // We get up-to-date information in English localization

Last updated