Skip to content

Tag: node.js

Async Loop Not Honoring Async

I have been a bit stuck on an Async function. What I am trying to accomplish – I am creating a batchProcessing function (batchGetSubs) which will loop through a set of files, read a ID, then make an API request, wait for a response (THE ISSUE) and then to write to a new file with the formatted data. The…

Error picking up the user’s avatar (discord.js)

Code Error: Since when I started using discord.js V12 i walk with many doubts and one of them is, how to catch the avatar of a user? Can someone help me? I know it’s a stupid doubt but I really don’t know Answer message.author.avatar is not a method. You need message.author.avatarURL As mentioned …

Node.js: fs.existsSync doesn’t work on Heroku

I have a Heroku app using Node.js and Express, and I want to determine whether or not a certain file exists. However, it seems like the file is never found. I have the following path: The directory structure of my project looks like this: I am doing something wrong here? Or is this a Heroku issue? Answer Ok, …

Returning Value From Callback in a Map

My problem is depending on the result of an asynchronous operation during a map. I know similar questions have been asked, but cannot quite figure out how to apply this to my case. I have figured out how to solve my problem using synchronous methods, my code is as follows, I want to try writing this using asy…