Discord.JS First Slash command guide not working

when I use the /ping command I get "The Application did not respond in time": I have deployed the deploy-commands.ts code and it ran successfully. Here is my code for my ping.ts command: const { SlashCommandBuilder } = require('discord.js'); module.exports = { data: new SlashCommandBuilder() .setName('ping') .setDescription('Replies with Pong!'), async execute(interaction : any) { await interaction.reply('Pong!'); }, };
No description
No description
22 Replies
d.js toolkit
d.js toolkit4w ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
moodman
moodmanOP4w ago
Don't have any error messages while running any file the code in the picture above is for the deploy-commands.ts
moodman
moodmanOP4w ago
and here is main.ts
No description
TÆMBØ
TÆMBØ4w ago
How are you running the code?
moodman
moodmanOP4w ago
so to run the deploy script
TÆMBØ
TÆMBØ4w ago
Are you transpiling it first and running the outputted JS or using something like ts-node?
moodman
moodmanOP4w ago
i just do npm run dev in the terminal
moodman
moodmanOP4w ago
No description
moodman
moodmanOP4w ago
i got the package.json i just change the name of the file to ruin the deploy script since it says u just needa run it once then i go back and keep the main script running
TÆMBØ
TÆMBØ4w ago
Ok, I would make sure your command files are actually being loaded
d.js docs
d.js docs4w ago
If you aren't getting any errors, try to place console.log checkpoints throughout your code to find out where execution stops. - Once you do, log relevant values and if-conditions - More sophisticated debugging methods are breakpoints and runtime inspections: learn more
moodman
moodmanOP4w ago
ya already done let me show u
moodman
moodmanOP4w ago
No description
moodman
moodmanOP4w ago
sec
moodman
moodmanOP4w ago
No description
moodman
moodmanOP4w ago
thats for this for loop right here meaning i can get the command
moodman
moodmanOP4w ago
No description
moodman
moodmanOP4w ago
but if i put it in this part it wont show the client.on part
TÆMBØ
TÆMBØ4w ago
Events.InteractionCreate
d.js docs
d.js docs4w ago
TÆMBØ
TÆMBØ4w ago
The enum member names are case-sensitive
moodman
moodmanOP4w ago
oh my god ok thanks its fixed idk how u caught that but good work G
Want results from more Discord servers?
Add your server