xDimGG / node-steamapi

An object-oriented Steam API wrapper for Node.js developers.
https://www.npmjs.com/package/steamapi
183 stars 44 forks source link

TypeError: No match #41

Closed oldmagic closed 1 year ago

oldmagic commented 1 year ago

C:\bot\node_modules\steamapi\src\SteamAPI.js:117 : Promise.reject(new TypeError(json.response.message)) ^

TypeError: No match at C:\bot\node_modules\steamapi\src\SteamAPI.js:117:23 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v19.1.0 NPM v9.2.0

i think it's from this code:

s[1] = SteamName

steam.resolve(id/${s[1]}/).then(id => { console.log(id: ${id})

Any ideas on what's is up ?

Pufikas commented 1 year ago

Hey have you tried this? Not sure if this is what you wanted

s = [SteamID, 'Pufikas'] steam.resolve(id/${s[1]}/).then(id => { console.log(id: ${id}) })

xDimGG commented 1 year ago

@oldmagic can you please tell me what SteamName is

oldmagic commented 1 year ago

@oldmagic can you please tell me what SteamName is

Hello and sorry for the late respond. SteamName is exactly what it looks like to be, your steam name. I'm not sure if i solved this or not beacuse it has been a while since did any work with this code.

xDimGG commented 1 year ago

Are you taking user input? This error could just be from users entering a steam name that doesn't exist. I suggest adding a .catch (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch) and telling the user that there was no match for the steam ID.