- What's your exact discord.js
npm list discord.jsand nodenode -vversion? - Not a discord.js issue? Check out #1081585952654360687.
- 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
#Problem with AddFields
6 messages · Page 1 of 1 (latest)
[
1,
CombinedPropertyError: Received one or more errors
at _ObjectValidator.handleIgnoreStrategy (C:\Users\muqia\Documents\Projects\HaroonBot\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:2002:72)
at _ObjectValidator.handleStrategy (C:\Users\muqia\Documents\Projects\HaroonBot\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:1872:47)
at _ObjectValidator.handle (C:\Users\muqia\Documents\Projects\HaroonBot\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:1972:17)
at _ObjectValidator.run (C:\Users\muqia\Documents\Projects\HaroonBot\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:925:23)
at _ArrayValidator.handle (C:\Users\muqia\Documents\Projects\HaroonBot\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:1199:37)
at _ArrayValidator.parse (C:\Users\muqia\Documents\Projects\HaroonBot\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:939:90)
at InfoEmbed.addFields (C:\Users\muqia\Documents\Projects\HaroonBot\node_modules\@discordjs\builders\dist\index.js:225:31)
at getEmbedJob (C:\Users\muqia\Documents\Projects\HaroonBot\dist\modules\helpers.js:29:10)
at Object.<anonymous> (C:\Users\muqia\Documents\Projects\HaroonBot\dist\commands\use.js:305:72)
at Generator.next (<anonymous>) {
errors: [ [ 'value', [ExpectedConstraintError] ] ]
}
]
]
}
Node.js v20.10.0```
my code
export function getEmbedJob(job: Post) {
const embed = new InfoEmbed('Confirm Your Post', 'Below are the details of your post. Make sure they match up to the standards and are correct. Failing to do so may result in a temporary or permanent ban from using our services.')
.addFields(
{
name: 'Post Type',
value: getNameByValue(job.jobType) || '',
},
{
name: 'Post Category',
value: getLabelByValue(job.job) || '',
},
);
if (job.jobTitle !== '') embed.addFields({ name: 'Post Title', value: job.jobTitle });
if (job.jobDesc !== '') embed.addFields({ name: 'Post Description', value: job.jobDesc });
if (job.jobBudget !== '') embed.addFields({ name: 'Post Budget', value: job.jobBudget });
if (job.jobDeadline !== '') embed.addFields({ name: 'Post Deadline', value: job.jobDeadline });
if (job.jobLocation !== '') embed.addFields({ name: 'Post Preferred Location', value: job.jobLocation });
if (job.jobPortfolio !== '') embed.addFields({ name: 'Post Portfolio', value: job.jobPortfolio });
embed.setFooter({ text: `POST ID : ${job.jobId} | <@${job.jobCreatorId}> | ${getDateFromMs(job.jobTimes.posted)}` });
return embed;
}
const confirmEmbed = getEmbedJob(job)
const confirmBtn = new ButtonBuilder().setCustomId('confirmBtn').setLabel('Confirm').setStyle(ButtonStyle.Danger)
const cancelBtn = new ButtonBuilder().setCustomId('cancelBtn').setLabel('Cancel').setStyle(ButtonStyle.Secondary)
const confirmCancelBtnRow = new ActionRowBuilder<ButtonBuilder>().addComponents(confirmBtn, cancelBtn)
i.reply(
{
embeds: [confirmEmbed],
components: [confirmCancelBtnRow],
ephemeral: true,
}
)```
value can’t be an empty string. But you use one as fallback…