#Can someone help me pls

39 messages · Page 1 of 1 (latest)

civic cove
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

abstract kiln
#

didn't resolve the promise from import()

silent kindle
#

how can i resolve it?

still doveBOT
hasty saffron
#

🐌

silent kindle
#

is this right?

abstract kiln
#

no

#

and you can import REST and Routes from djs itself

silent kindle
abstract kiln
#

yes

silent kindle
abstract kiln
#

you were told what the issue was, given resources to fix it, and then you replace your almost-working code with something completely irrelevant

abstract kiln
#

time for you to help yourself

silent kindle
#

is Line 13 right?

And I have to resolve the result?

abstract kiln
#

you have to resolve the promise given from import()

silent kindle
#

Shouldn't this be right?

abstract kiln
#

not quite, but the error is just about how you've exported it

#

here you should either use await, or use then inside Promise.all(...map(...))

silent kindle
#

Do I have an error in my ping.js?

abstract kiln
#

the result of import() will look like { default: { data: ..., execute: ... } }

silent kindle
abstract kiln
#

well what did i say

silent kindle
#

but

#

if i write command.data.toJSON()

#

I get this

abstract kiln
#

yeah because it doesn't exist, and that's not how promises work

abstract kiln
#

that's not how await works, please learn how to handle promises properly

silent kindle
#

ok, thanks for your help

ebon mortar
#

Don't delete your original message in the future, it won't help future people with the same problem (':

silent kindle
#

The problem is not solved

ebon mortar
#

Just reading this conversation, it is solved

#

Whether you understand what people are telling you is another question

#

This is a basic JavaScript question and not related to discord.js