Roreos
DIAdiscord.js - Imagine an app
•Created by Roreos on 10/3/2023 in #djs-questions
Searching for a directory that is non-existent
Hello, I keep trying to figure this out but the code is not working and keeps trying to look for a directory thats not made.
Error:
Code:
Uncaught Error Error: ENOENT: no such file or directory, scandir '(my files)\discord-bot\commands\support\commands\support'
at readdirSync (fs:1527:3)
at <anonymous> ((my files)\discord-bot\commands\support\feedback.js:12:31)
at Module._compile (internal/modules/cjs/loader:1256:14)
at Module._extensions..js (internal/modules/cjs/loader:1310:10)
at Module.load (internal/modules/cjs/loader:1119:32)
at Module._load (internal/modules/cjs/loader:960:12)
at Module.require (internal/modules/cjs/loader:1143:19)
at require (internal/modules/cjs/helpers:119:18)
at <anonymous> ((my files)\discord-bot\deploy-commands.js:18:19)
at Module._compile (internal/modules/cjs/loader:1256:14)
at Module._extensions..js (internal/modules/cjs/loader:1310:10)
at Module.load (internal/modules/cjs/loader:1119:32)
at Module._load (internal/modules/cjs/loader:960:12)
at executeUserEntryPoint (internal/modules/run_main:86:12)
at <anonymous> (internal/main/run_main_module:23:47)
Uncaught Error Error: ENOENT: no such file or directory, scandir '(my files)\discord-bot\commands\support\commands\support'
at readdirSync (fs:1527:3)
at <anonymous> ((my files)\discord-bot\commands\support\feedback.js:12:31)
at Module._compile (internal/modules/cjs/loader:1256:14)
at Module._extensions..js (internal/modules/cjs/loader:1310:10)
at Module.load (internal/modules/cjs/loader:1119:32)
at Module._load (internal/modules/cjs/loader:960:12)
at Module.require (internal/modules/cjs/loader:1143:19)
at require (internal/modules/cjs/helpers:119:18)
at <anonymous> ((my files)\discord-bot\deploy-commands.js:18:19)
at Module._compile (internal/modules/cjs/loader:1256:14)
at Module._extensions..js (internal/modules/cjs/loader:1310:10)
at Module.load (internal/modules/cjs/loader:1119:32)
at Module._load (internal/modules/cjs/loader:960:12)
at executeUserEntryPoint (internal/modules/run_main:86:12)
at <anonymous> (internal/main/run_main_module:23:47)
const { Client, GatewayIntentBits } = require('discord.js');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { clientId, token } = require('../../config.json');
const fs = require('fs');
const path = require('path');
const commands = [];
// Collect your custom commands
const customCommandsPath = path.join(__dirname, 'commands/support'); // Corrected path here
const customCommandFiles = fs.readdirSync(customCommandsPath).filter(file => file.endsWith('.js'));
for (const file of customCommandFiles) {
const feedback = require(path.join(customCommandsPath, file));
commands.push(feedback.data.toJSON()); // Push each command to the commands array
}
const rest = new REST({ version: '10' }).setToken(token);
(CUT IT SHORT DUE TO NO SPACE)
const { Client, GatewayIntentBits } = require('discord.js');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { clientId, token } = require('../../config.json');
const fs = require('fs');
const path = require('path');
const commands = [];
// Collect your custom commands
const customCommandsPath = path.join(__dirname, 'commands/support'); // Corrected path here
const customCommandFiles = fs.readdirSync(customCommandsPath).filter(file => file.endsWith('.js'));
for (const file of customCommandFiles) {
const feedback = require(path.join(customCommandsPath, file));
commands.push(feedback.data.toJSON()); // Push each command to the commands array
}
const rest = new REST({ version: '10' }).setToken(token);
(CUT IT SHORT DUE TO NO SPACE)
4 replies
DIAdiscord.js - Imagine an app
•Created by Roreos on 10/3/2023 in #djs-questions
Cannot read properties of undefined (reading 'FLAGS')
I get the error above, here is the error:
Here is my code:
(stops here with not enough space)
Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'FLAGS')
at <anonymous> (c:\Users\theor\3D Objects\discord-bot\commands\support\TicketSystem.js:14:15)
at Module._compile (internal/modules/cjs/loader:1256:14)
at Module._extensions..js (internal/modules/cjs/loader:1310:10)
at Module.load (internal/modules/cjs/loader:1119:32)
at Module._load (internal/modules/cjs/loader:960:12)
at Module.require (internal/modules/cjs/loader:1143:19)
at require (internal/modules/cjs/helpers:119:18)
at <anonymous> (c:\Users\theor\3D Objects\discord-bot\deploy-commands.js:18:19)
at Module._compile (internal/modules/cjs/loader:1256:14)
at Module._extensions..js (internal/modules/cjs/loader:1310:10)
at Module.load (internal/modules/cjs/loader:1119:32)
at Module._load (internal/modules/cjs/loader:960:12)
at executeUserEntryPoint (internal/modules/run_main:86:12)
at <anonymous> (internal/main/run_main_module:23:47)
Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'FLAGS')
at <anonymous> (c:\Users\theor\3D Objects\discord-bot\commands\support\TicketSystem.js:14:15)
at Module._compile (internal/modules/cjs/loader:1256:14)
at Module._extensions..js (internal/modules/cjs/loader:1310:10)
at Module.load (internal/modules/cjs/loader:1119:32)
at Module._load (internal/modules/cjs/loader:960:12)
at Module.require (internal/modules/cjs/loader:1143:19)
at require (internal/modules/cjs/helpers:119:18)
at <anonymous> (c:\Users\theor\3D Objects\discord-bot\deploy-commands.js:18:19)
at Module._compile (internal/modules/cjs/loader:1256:14)
at Module._extensions..js (internal/modules/cjs/loader:1310:10)
at Module.load (internal/modules/cjs/loader:1119:32)
at Module._load (internal/modules/cjs/loader:960:12)
at executeUserEntryPoint (internal/modules/run_main:86:12)
at <anonymous> (internal/main/run_main_module:23:47)
const { Client, Intents } = require('discord.js');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const path = require('path');
// Construct the absolute path to config.json
const configPath = path.join(__dirname, '../../config.json');
// Require the configuration file
const { token, clientId } = require(configPath);
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES, // Add this if you want to handle messages.
],
});
const { Client, Intents } = require('discord.js');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const path = require('path');
// Construct the absolute path to config.json
const configPath = path.join(__dirname, '../../config.json');
// Require the configuration file
const { token, clientId } = require(configPath);
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES, // Add this if you want to handle messages.
],
});
(stops here with not enough space)
5 replies
DIAdiscord.js - Imagine an app
•Created by Roreos on 9/29/2023 in #djs-questions
Bot deleted off dashboard, what happens to code?
Hi, I had to delete my bot off of the discord dev dashboard, and created a new one and assigned the token and all the stuff I had to do to it. My command is no longer there when I try to execute it. Do I have to delete all the files and restart?
18 replies
DIAdiscord.js - Imagine an app
•Created by Roreos on 9/28/2023 in #djs-questions
Can't find out where code needs to be
9 replies