Some error that I do not understand

I have a code and it has a few problems. Even if it is not the console saying it, but you see something bad in it, tell me. The console error is: Unexpected error: TypeError: (intermediate value).setTitle(...).setDescription(...).addField is not a function at askQuestion (D:\atermibot\index.js:130:26) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async askQuestion (D:\atermibot\index.js:113:21) at async askQuestion (D:\atermibot\index.js:113:21) at async askQuestion (D:\atermibot\index.js:113:21) at async askQuestion (D:\atermibot\index.js:113:21) at async Client.<anonymous> (D:\atermibot\index.js:142:9) And the code is: https://sourceb.in/ot4siSAXRQ
11 Replies
d.js toolkit
d.js toolkit4mo 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! - Marked as resolved by OP
BMmarci1234
BMmarci1234OP4mo ago
Hope that anyone can help me.
treble/luna
treble/luna4mo ago
its addFields
BMmarci1234
BMmarci1234OP4mo ago
oh so i just missed an 's'? silly me let me try again
treble/luna
treble/luna4mo ago
not really no, you are using an outdated method you used it correctly before
BMmarci1234
BMmarci1234OP4mo ago
I made it like that and that is the error: Unexpected error: CombinedPropertyError (2) Received one or more errors input[0] | ValidationError > s.object(T) | Expected the value to be an object, but received string instead | | Received: | | 'Válaszok' input[1] | ValidationError > s.object(T) | Expected the value to be an object, but received string instead | | Received: | | 'A, D, C, A' at _ArrayValidator.handle (D:\atermibot\node_modules@sapphire\shapeshift\dist\cjs\index.cjs:1205:70) at _ArrayValidator.parse (D:\atermibot\node_modules@sapphire\shapeshift\dist\cjs\index.cjs:939:90) at EmbedBuilder.addFields (D:\atermibot\node_modules@discordjs\builders\dist\index.js:228:31) at askQuestion (D:\atermibot\index.js:130:26) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async askQuestion (D:\atermibot\index.js:113:21) at async askQuestion (D:\atermibot\index.js:113:21) at async askQuestion (D:\atermibot\index.js:113:21) at async askQuestion (D:\atermibot\index.js:113:21) at async Client.<anonymous> (D:\atermibot\index.js:142:9)
treble/luna
treble/luna4mo ago
it takes an array of APIEmbedField
BMmarci1234
BMmarci1234OP4mo ago
Wdym So how do i correct it
treble/luna
treble/luna4mo ago
you use the correct syntex just like you did on line 88
BMmarci1234
BMmarci1234OP4mo ago
oh right let me try again. So is this like this? const resultEmbed = new EmbedBuilder() .setTitle("Kérdőív Eredmény") .setDescription(${message.author.username} válaszai a következőek voltak:) .addFields( { name: "Válaszok", value: answers.join(', ') }, { name: "Idő", value: new Date().toLocaleString() } )
treble/luna
treble/luna4mo ago
yes
Want results from more Discord servers?
Add your server