#now this error prompts stating `invalid

1 messages · Page 1 of 1 (latest)

white comet
#

show the full code

#

what makes this crash happen

thorn coral
#

I'm guessing that's him registering commands

quartz stone
#

and the slash command

quartz stone
tawdry chasm
quartz stone
#

alright

thorn coral
#

I'm guessing this is the issue

quartz stone
tawdry chasm
quartz stone
thorn coral
#

Map only the data

#

Not the execute code

quartz stone
#

elaborate?

tawdry chasm
thorn coral
#

and you want it as a json I believe

white comet
#

the reason is because you provide Collection to the body, but it should be an array

quartz stone
#

as referred to the guide, yes

quartz stone
white comet
#

in "body" property, when setting application commands, change client.commands.map() to client.commands.map(c => c.data)

white comet
quartz stone
#

the application now responds

#

so i just had to specify the data?

tawdry chasm
#

yes

quartz stone
#

ah

white comet
#

well, the issue was you were providing Collection class to the body, while it should be array instance. Collection is like a "better array" from discord.js, so thats why they made you use it. So, what we did, is "parsed" client.commands, which is Collection type of to array type, using map(), because it returns an array

quartz stone
#

ohhh

#

well thanks to all 3 of you for helping, appreciate it

white comet
#

np

thorn coral
#

No worries