Exenis
Exenis
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
appreciate ya'll for the replies
20 replies
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
usually it should've been gone by now
20 replies
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
yeah must've been the other server
20 replies
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
(unless it is because of the other server)
20 replies
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
should stop working soon
20 replies
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
as of rn
20 replies
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
20 replies
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
have turned it off, will check in a minute
20 replies
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
database etc does work on the new server, turning the old server off rn
20 replies
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
uhmm possibly actually
20 replies
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
deploy-commands gets manually ran, cache gets cleared and the command is there, few min later command stops working, I clear my cache again it's gone, very very odd
20 replies
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
yes sir it does
20 replies
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
would seem odd to me if it was the deploy script as every time I have updated commands it worked fine
20 replies
DIAdiscord.js - Imagine an app
Created by Exenis on 9/13/2024 in #djs-questions
Command dissapears
const { REST, Routes } = require("discord.js");
const { clientId, token } = require("./config.json");
const fs = require("node:fs");
const path = require("node:path");

const commands = [];
const foldersPath = path.join(__dirname, "commands");
const commandFolders = fs.readdirSync(foldersPath);

for (const folder of commandFolders) {
const commandsPath = path.join(foldersPath, folder);
const commandFiles = fs
.readdirSync(commandsPath)
.filter((file) => file.endsWith(".js"));
for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
if ("data" in command && "execute" in command) {
commands.push(command.data.toJSON());
} else {
console.log(
`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`
);
}
}
}

const rest = new REST().setToken(token);

(async () => {
try {
console.log(
`Started refreshing ${commands.length} application (/) commands.`
);

await rest.put(
Routes.applicationCommands(clientId),
{ body: commands }
);

console.log(
`Successfully reloaded ${commands.length} application (/) commands.`
);
} catch (error) {
console.error(error);
}
})();
const { REST, Routes } = require("discord.js");
const { clientId, token } = require("./config.json");
const fs = require("node:fs");
const path = require("node:path");

const commands = [];
const foldersPath = path.join(__dirname, "commands");
const commandFolders = fs.readdirSync(foldersPath);

for (const folder of commandFolders) {
const commandsPath = path.join(foldersPath, folder);
const commandFiles = fs
.readdirSync(commandsPath)
.filter((file) => file.endsWith(".js"));
for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
if ("data" in command && "execute" in command) {
commands.push(command.data.toJSON());
} else {
console.log(
`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`
);
}
}
}

const rest = new REST().setToken(token);

(async () => {
try {
console.log(
`Started refreshing ${commands.length} application (/) commands.`
);

await rest.put(
Routes.applicationCommands(clientId),
{ body: commands }
);

console.log(
`Successfully reloaded ${commands.length} application (/) commands.`
);
} catch (error) {
console.error(error);
}
})();
20 replies