'MessageEmbed' is declared but its value is never read.
I have no idea why this has happened, its my first encounter with this error.
47 Replies
- 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!
- ✅
Marked as resolved by staff
Yes, this code is above the other one.
full stack error.
im wondering why you have 3 imports to discord.js nevertheless this means your field values hasnt got any data
also, the warning that you get is because you deconstruct MessageEmbed but you never call it
You call Discord.MessageEmbed
because of this
you indeed never use it
instead you’re using Discord.MessageEmbed
when I remove it its the same error though
as you're told, why do you have 3 imports
Either destructure or dont, but not both
When I delete the imports it gives the same error
.
so pick what you want
How do I desturcture it exactly
Destructuring assignment
The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.
Pretty basic js
Okay but why do I need to destructure if I just delete the imports and dont use them?
its up to you what you want to do
I did delete the imports
killing your bot every time a ratelimit happens is a bad idea
and wont magically solve it
I have an uptimer which auto-restarts when its not working
thats why
well yeah but ratelimits wont crash your bot
ratelimits can happen quite often
but they don't cause your bot to crash so there's no need to kill it
Nor will it solve it
it does crash them
Then catch your rejections properly
it goes offline and never back online when I don't add them
I highly doubt thats due to a ratelimit but ok i guess
well still I dont understand whats the problem now
the error says its about
.addFields
One of your field values is empty
how so
the error tells you
So log your values
one of those is empty
so the city and districts are empty
or well, rather undefined
yeah
well thats a problem with the API I am using
well I removed them completely
and it still gives the same error
even though the magnitude does have a value
they also must be strings
what do you mean?
the values must be strings?
yes
so
${earthquakeData.mag}
?yes
well that also didnt work
didnt work in what way
thats not a template literal
Template literals (Template strings)
Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded expressions, and special constructs called tagged templates.
i feel kinda dumb for forgetting that
well the code now works, thank you
but uh the API is not working
so thank you so much for you help
what vscode theme?
Its not VScode
its replit
The theme is "Coding Time"