SnaBe / node-steam-market-fetcher

A Node.js wrapper for the Steam Community Market API.
https://www.npmjs.com/package/steam-market-fetcher
MIT License
26 stars 3 forks source link

Hi I need your help! #9

Closed xMyThoLoGyx closed 3 years ago

xMyThoLoGyx commented 3 years ago

I'm trying to use this code in my discord bot and I keep getting this error:

Promise { } F:\Discord Bots\DisGo Bot v13\DisGo - Invitable\node_modules\steam-market-fetcher\lib\utils.js:35 return (image_url.includes('62fx62f')) ? image_url.replace('62fx62f', ${px}fx${px}f) : image_url; ^

TypeError: Cannot read property 'includes' of undefined at Object.resizeImage (F:\Discord Bots\DisGo Bot v13\DisGo - Invitable\node_modules\steam-market-fetcher\lib\utils.js:35:23) at F:\Discord Bots\DisGo Bot v13\DisGo - Invitable\node_modules\steam-market-fetcher\index.js:79:45 at processTicksAndRejections (node:internal/process/task_queues:96:5)

Can we schedule a discord call? MyThoLoGy#8718

SnaBe commented 3 years ago

I'll need a little more information before I can replicate this error.

Best regards, SnaBe

xMyThoLoGyx commented 3 years ago

Hey, it'd be much easier if I could show you the code with screenshare. Could we talk on discord?

SnaBe commented 3 years ago

If you find it necessary to solve your issue or it makes it easier for you, I'll give it a shot as usually don't provide this level of assistance. I'll add you on Discord.

SnaBe commented 3 years ago

The issue has been solved and originated from the missing use of await instead of then(). The core of the issue was with how the function calling getItemImage() handles the execution of asynchronous calls.