yuko1101 / enka-network-api Goto Github PK
View Code? Open in Web Editor NEWA Node.js Enka.Network API wrapper for Genshin Impact.
Home Page: https://enka-network-api.vercel.app
License: MIT License
A Node.js Enka.Network API wrapper for Genshin Impact.
Home Page: https://enka-network-api.vercel.app
License: MIT License
OS => Debian GNU/Linux 11 (bullseye)
Node.js => v18.16.0
npm => 9.5.1
enka-network-api => 3.2.0
When the sample was run, the following error occurred
(JSON Data)
SyntaxError: Unexpected token _ in JSON at position 0
at JSON.parse (<anonymous>)
at CachedAssetsManager.getGenshinCacheData (/home/~~~/test/node_modules/enka-network-api/dist/client/CachedAssetsManager.js:318:69)
at EnkaClient.getAllWeapons (/home/~~~/test/node_modules/enka-network-api/dist/client/EnkaClient.js:242:50)
at Object.<anonymous> (/home/~~~/test/weapon.js:4:22)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
Node.js v18.16.0
Am I doing something wrong?
Thank you.
Hello i want to get character accession data but i got this error
if (!this._data) throw new AssetsNotFoundError("CharacterAscension", `${id}-${ascension}`);
^
AssetsNotFoundError: CharacterAscension 46-20 was not found. Try to update cached assets with EnkaClient#cachedAssetsManager#fetchAllContents
i already add EnkaClient#cachedAssetsManager#fetchAllContents
to my code but still getting the error
const { EnkaClient } = require("enka-network-api");
const enka = new EnkaClient({ cacheDirectory: "./cache" });
enka.cachedAssetsManager.cacheDirectorySetup();
enka.cachedAssetsManager.fetchAllContents();
const character = enka.getCharacterById(10000046)
console.log(character.name.get('id'))
const ascend = character.getAscensionData(20)
console.log(ascend)
Hello !
First, thanks for this very nice wrapper 😁 !
Like allCharacters and allWeapons, is it possible to list all the artifacts ?
And why node>=16 for the requirements ?
Thanks !
Doing
const characters = enka.getAllCharacters(); console.log(characters.map(c => c.name.get("en")));
returns
[
'Kamisato Ayaka', 'Jean', 'Traveler',
'Traveler', 'Traveler', 'Traveler',
'Lisa', 'Traveler', 'Traveler',
'Traveler', 'Traveler', 'Barbara',
'Kaeya', 'Diluc', 'Razor',
'Amber', 'Venti', 'Xiangling',
'Beidou', 'Xingqiu', 'Xiao',
'Ningguang', 'Klee', 'Zhongli',
'Fischl', 'Bennett', 'Tartaglia',
'Noelle', 'Qiqi', 'Chongyun',
'Ganyu', 'Albedo', 'Diona',
'Mona', 'Keqing', 'Sucrose',
'Xinyan', 'Rosaria', 'Hu Tao',
'Kaedehara Kazuha', 'Yanfei', 'Yoimiya',
'Thoma', 'Eula', 'Raiden Shogun',
'Sayu', 'Sangonomiya Kokomi', 'Gorou',
'Kujou Sara', 'Arataki Itto', 'Yae Miko',
'Shikanoin Heizou', 'Yelan', 'Aloy',
'Shenhe', 'Yun Jin', 'Kuki Shinobu',
'Kamisato Ayato', 'Collei', 'Dori',
'Tighnari', 'Nilou', 'Cyno',
'Candace', 'Nahida', 'Layla'
]
import { EnkaClient } from "enka-network-api";
const enka = new EnkaClient({ defaultLanguage: "jp"});
const characters = enka.getAllCharacters();
console.log(characters.map(x => ({ [x.id]: x.name.get("jp") })));
// is work
const weapons = enka.getAllWeapons();
console.log(weapons.map(x => x.name.get("jp")));
// is not work
Error
if (!text) throw new AssetsNotFoundError("Text Assets", this.id);
^
AssetsNotFoundError: Text Assets 1135130229 was not found. Try to update cached assets using EnkaClient#cachedAssetsManager#fetchAllContents
I've been trying to figure out why these are not working.
Not sure if they are related.
https://github.com/Dimbreath/GenshinData
The above repositories are 404'd.
https://i.imgur.com/NMl7oSr.png
The enka-network document mentions
https://github.com/Dimbreath/GenshinData/blob/master/ExcelBinOutput/WeaponExcelConfigData.json
also returns 404 as a matter of course.
11101
This is the same as
Enka.getAllWeapons()
The id obtained.
node_modules\enka-network-api\cache\langs\jp.json
I tried to find the target id (11101), but it did not exist
My guess is that when the cache is created, it is trying to get all the weapons information from enka-network in some way.
but because it could not be retrieved, the cache of weapon information is not generated.
That is why I guessed the above error occurs.
To fix this, you need to get the weapons information for all languages from another service or from another source.
If you can find a service that can retrieve the weapons information in all languages, please update the module.
Also, if you have difficulty updating the module, please let me know.
I look forward to hearing from you!
I can not access the Enka to update my infos.I try to access by Browser But it call 529 error about SSL certificate,How should I do?
I cannot serach the my information using this api
my UID is 142967086
this is the log:
E:\蒙德同好会专用BOT\node_modules\enka-network-api\src\models\weapon\Weapon.js:25
this.refinement = this.weaponData.refinements[data.weapon.affixMap[this.weaponData._data.skillAffix[0]] ?? 0];
^
TypeError: Cannot read properties of undefined (reading '0')
at new Weapon (E:\蒙德同好会专用BOT\node_modules\enka-network-api\src\models\weapon\Weapon.js:25:75)
at new Character (E:\蒙德同好会专用BOT\node_modules\enka-network-api\src\models\character\Character.js:34:23)
at E:\蒙德同好会专用BOT\node_modules\enka-network-api\src\models\User.js:75:60
at Array.map ()
at new User (E:\蒙德同好会专用BOT\node_modules\enka-network-api\src\models\User.js:75:51)
at EnkaClient.fetchUser (E:\蒙德同好会专用BOT\node_modules\enka-network-api\src\client\EnkaClient.js:57:16)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
hello i got this error when doing
`const { EnkaClient } = require("enka-network-api");
const enka = new EnkaClient();
enka.fetchUser(858576029).then(user => {
console.log(user);
});`
and when i go to
Artifact.js and remove line 48 it didn't show any error!
The error `D:\coding-essentials\project\Discord.js-v14\node_modules\enka-network-api\src\models\artifact\Artifact.js:48
split: data.reliquary.appendPropIdList.map(id => new ArtifactSplitSubstat(id, enka)),
^
TypeError: Cannot read properties of undefined (reading 'map')`
Hello!
This code
const user = await enka.fetchUser(123456789, false) as DetailedUser;
console.log(user.profileCard.icon.url);
Logs this url
https://api.ambr.top/assets/UI/UI_NameCardIcon_Cyno.png
But this page does not exist... Am I doing something wrong?
We need this api to publish to npmjs,thanks!
Will there be validation for Serenitea Pot Replica ID's like this library does with HoyoVerse UID's?
When use enka-network-api in Yunzai-Bot, report AbortController is not defined, and the source code
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.