loading Slash Commands with REST dont works

it just stop here and don't load the commands , dont return any erros
22 Replies
d.js docs
d.js docs2y ago
• 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.
Youssef
Youssef2y ago
this is what my CommandsArray look likes
Youssef
Youssef2y ago
and this is rest definition
Youssef
Youssef2y ago
i use v14
YP501
YP5012y ago
I think you're passing in the wrong command info array The command array you're supposed to pass in is an array consisting of the command info objects generated by the SlashCommandBuilder instead of the whole file which you're doing Example:
const info = new SlashCommandBuilder()
.setName('ping')
.setDescription('Check bot and API latency');
const info = new SlashCommandBuilder()
.setName('ping')
.setDescription('Check bot and API latency');
creates
{
options: [],
name: 'ping',
name_localizations: undefined,
description: 'Check bot and API latency',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: undefined,
dm_permission: undefined
}
{
options: [],
name: 'ping',
name_localizations: undefined,
description: 'Check bot and API latency',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: undefined,
dm_permission: undefined
}
and if you push that info object to an array for each command you have and use that array as the REST body it should work
Youssef
Youssef2y ago
i don't use builders how i can know? to be sure + reseting token helps?. edit:didn't work
duck
duck2y ago
is this on replit? @synsetz
Youssef
Youssef2y ago
yes why
duck
duck2y ago
as of late, I've seen more and more people with hanging promises on replit, and someone mentioned it's entirely possible that the shared ip was banned consider just not using replit
Youssef
Youssef2y ago
if i have money i wouldn't use replit i use replit from 1 year now, I don't this is with replit 🙂 Idk
duck
duck2y ago
a lot of people can use and get an ip banned in a year, I don't believe that having used it for a year would prove that it's not a replit issue
Youssef
Youssef2y ago
so what should i do well I have 2 bots, my other bot is working fine
duck
duck2y ago
do you have a computer?
Youssef
Youssef2y ago
yes ofc
duck
duck2y ago
(I ask because it's not "of course", a few people have come through here without computers because of how poor they are) just try deploying your commands off your computer first
Youssef
Youssef2y ago
of course don't mean im rich, i stay years to but it what i mean i if i code a bot i should be with pc just try deploying your commands off your computer first what this mean didn't get it
duck
duck2y ago
your command deployment script run on your computer
if i code a bot i should be with pc
me too, but not everyone shares that sentiment
Youssef
Youssef2y ago
u mean i run the bot with visual studio code or? yeah I'm not the best at English
duck
duck2y ago
well vscode is an IDE if you have node installed, you can run it from whatever terminal you have
Youssef
Youssef2y ago
so this is what u tell me to do? u mean i try run the bot from another something not replit
duck
duck2y ago
yes
Youssef
Youssef2y ago
ok I'll try