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)Here is my code:
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)
