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 toolkit12mo 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
Danial12mo ago
discord.js doesn't export anything called Discord, it does export Client though
Fyphen
Fyphen12mo 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.ts12mo ago
its EmbedBuilder not embedBuilder
Fyphen
Fyphen12mo ago
Ooops sorry sir *typo
Want results from more Discord servers?
Add your server