enkaNetwork
GitHubNPM
  • ✨Overview
  • 📦Quick Start | Installation
  • 🖇️TypeScript usage
  • ⚙️Class description
    • 📝EnkaNetwork
    • 💾AssetsUpdater
    • 🔎AssetsFinder
  • 🔗Methods
    • 👤fetchUser
    • 🕵️fetchProfileInfo
    • 🌟fetchEnkaProfile
    • 📕fetchEnkaHoyos
    • 🔹fetchEnkaHoyo
    • 🟣fetchEnkaHoyoBuilds
    • 🚩setLanguage
  • 🎓Models
    • EnkaProfile
    • Character
      • Character
      • CharacterConstellation
      • CharacterReliquary
      • CharacterSkill
      • CharacterStats
      • CharacterWeapon
    • PlayerInfo
      • CharacterPreview
      • Namecard
      • PlayerInfo
      • ProfilePicture
    • Fetcher
      • FetchEnkaHoyosBuilds
      • FetchEnkaHoyo
      • FetchEnkaProfile
      • FetchUserUID
      • FetchProfileInfo
  • ✏️Examples
    • 1️⃣Simple usage
    • 2️⃣Express API
    • 3️⃣Fastify API
    • 4️⃣Telegram bot
Powered by GitBook
On this page
  • languages
  • checkInterval
  • instant
  • fetchAssets()

Was this helpful?

  1. Class description

AssetsUpdater

PreviousEnkaNetworkNextAssetsFinder

Last updated 1 year ago

Was this helpful?

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

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
⚙️
💾
EnkaNetwork