Issue with Discord.js command deployment script

The script is designed to deploy application commands to a Discord bot, but it doesn't seem to complete successfully. It gets stuck after resetting the guild commands, and the process doesn't finish or show the final success message. I have checked the code, but I'm unable to figure out the root cause of this problem. Below is my code (It was heavily inspired from the https://discordjs.guide/creating-your-bot/command-deployment.html#guild-commands guide ) Here's the code: https://pastebin.com/sBK7nKJV I have tried to debug the code by adding some console.log statements, but it didn't provide any additional information. Could someone please help me identify what might be causing this issue and how I can resolve it?
Pastebin
Deploy Commands.js - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
9 Replies
d.js toolkit
d.js toolkit11mo 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. - Issue solved? Press the button!
grass
grass11mo ago
It seems your code is reaching the end to me though you reset global commands, then guild commands, and then you deploy global commands nevermind, out what was wrong
macha
macha11mo ago
yeah but the process doesn't finish or show the final success message and terminate after it, meaning it should show: Successfully reloaded (11) application (/) commands and terminate after it
grass
grass11mo ago
how do you define REST
macha
macha11mo ago
elaborate a little pls
grass
grass11mo ago
I don’t know how else to ask How are you defining REST
macha
macha11mo ago
i have not i have imported imported it using require function.
grass
grass11mo ago
then that’s how you defined it show me
macha
macha11mo ago
const { REST, Routes } = require('discord.js');
const { clientId, guildId, token } = require('./config.json');
const fs = require('node:fs');
const path = require('node:path');
const { REST, Routes } = require('discord.js');
const { clientId, guildId, token } = require('./config.json');
const fs = require('node:fs');
const path = require('node:path');
here Aaa, I realised now Thanks a lot ill wait for a few hours and try again yeah it works now thanks a lot i remove the clearing part