Importing multiple from discord.js having issues

Hello I have the line const { Discord, EmbedBuilder } = require('discord.js'); This causes issues with const client = new Discord.Client({ with the error
const client = new Discord.Client({
^
TypeError: Cannot read properties of undefined (reading 'Client')
const client = new Discord.Client({
^
TypeError: Cannot read properties of undefined (reading 'Client')
5 Replies
d.js toolkit
d.js toolkit7mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Danial
Danial7mo ago
discord.js doesn't export anything called Discord, it does export Client though
Fyphen
Fyphen7mo ago
more likely you have to
const Discord = require('discord.js');
const { embedBuilder } = require('discord.js');
const Discord = require('discord.js');
const { embedBuilder } = require('discord.js');
u know const Discord is instancing all of the discord.js but if we import them using JSON we can individually import
kin.ts
kin.ts7mo ago
its EmbedBuilder not embedBuilder
Fyphen
Fyphen7mo ago
Ooops sorry sir *typo