Pigeon
Pigeon
DIAdiscord.js - Imagine an app
Created by Pigeon on 6/23/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading 'send')
with settings.channel being a channel ID
const channel = client.channels.cache.get(settings.channel)
channel.send("e")
const channel = client.channels.cache.get(settings.channel)
channel.send("e")
40 replies
DIAdiscord.js - Imagine an app
Created by Pigeon on 6/23/2024 in #djs-questions
TypeError [ClientMissingIntents]: Valid intents must be provided for the Client.
This is what i have in my file :
const fs = require("fs");
const mineflayer = require("mineflayer");
const Discord = require('discord.js');
const {pathfinder, Movements, goals} = require('mineflayer-pathfinder');
const settings = JSON.parse(fs.readFileSync("./settings.json", "utf-8"));

const client = new Discord.Client();
client.login(settings.discordtoken);
const fs = require("fs");
const mineflayer = require("mineflayer");
const Discord = require('discord.js');
const {pathfinder, Movements, goals} = require('mineflayer-pathfinder');
const settings = JSON.parse(fs.readFileSync("./settings.json", "utf-8"));

const client = new Discord.Client();
client.login(settings.discordtoken);
Error :
throw new DiscordjsTypeError(ErrorCodes.ClientMissingIntents);
^

TypeError [ClientMissingIntents]: Valid intents must be provided for the Client.
at Client._validateOptions (C:\Users\gabri\OneDrive\Bureau\Projects\Oa bot\pigeonbot 1.0\node_modules\discord.js\src\client\Client.js:512:13)
at new Client (C:\Users\gabri\OneDrive\Bureau\Projects\Oa bot\pigeonbot 1.0\node_modules\discord.js\src\client\Client.js:80:10)
at Object.<anonymous> (C:\Users\gabri\OneDrive\Bureau\Projects\Oa bot\pigeonbot 1.0\bot.js:7:16)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
code: 'ClientMissingIntents'
}
throw new DiscordjsTypeError(ErrorCodes.ClientMissingIntents);
^

TypeError [ClientMissingIntents]: Valid intents must be provided for the Client.
at Client._validateOptions (C:\Users\gabri\OneDrive\Bureau\Projects\Oa bot\pigeonbot 1.0\node_modules\discord.js\src\client\Client.js:512:13)
at new Client (C:\Users\gabri\OneDrive\Bureau\Projects\Oa bot\pigeonbot 1.0\node_modules\discord.js\src\client\Client.js:80:10)
at Object.<anonymous> (C:\Users\gabri\OneDrive\Bureau\Projects\Oa bot\pigeonbot 1.0\bot.js:7:16)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
code: 'ClientMissingIntents'
}
This happens when i run it
21 replies