Embed message problem and no ping

The Problem is that i cant ping in the following code and some parameters as footer and author wont get set after modal was submitted
No description
No description
No description
40 Replies
d.js toolkit
d.js toolkit3mo 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!
d.js docs
d.js docs3mo ago
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
P H O E T A N I X
P H O E T A N I XOP3mo ago
ok
P H O E T A N I X
P H O E T A N I XOP3mo ago
Pastebin
SourceCodeDCBOT - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
P H O E T A N I X
P H O E T A N I XOP3mo ago
ping problem is fixed but setting embed data still not cancel button doesnt work either
An Unnormal Person =)
where did you handle the cancle button?
P H O E T A N I X
P H O E T A N I XOP3mo ago
I just found out as well that I forgot to paste it in my code ( i work seperately )
// "Cancel" is handled separately
if (i.customId === 'cancel') {
await i.deferUpdate();
await interaction.editReply({ content: 'Embed canceled.', components: [] });
buttonCollector.stop();
return;
}
// "Cancel" is handled separately
if (i.customId === 'cancel') {
await i.deferUpdate();
await interaction.editReply({ content: 'Embed canceled.', components: [] });
buttonCollector.stop();
return;
}
this is how i handle oh sorry if i ping didnt mean to
An Unnormal Person =)
as I see, you didn't handle your modal_author and modal_footer
P H O E T A N I X
P H O E T A N I XOP3mo ago
ohhh damn thanks
An Unnormal Person =)
where did you put this btw?
P H O E T A N I X
P H O E T A N I XOP3mo ago
under confirm button I will test rq and make another pastebin
An Unnormal Person =)
sure, take your time you can ping me later
P H O E T A N I X
P H O E T A N I XOP3mo ago
Pastebin
SourceCodeDCBOT2 - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
P H O E T A N I X
P H O E T A N I XOP3mo ago
now theres new problem error:
C:..\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:2615
return typeof value === "string" ? Result.ok(value) : Result.err(new ValidationError("s.string()", this.validatorOptions.message ?? "Expected a string primitive", value));
^

ValidationError: Expected a string primitive
at _StringValidator.handle (C:..node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:2615:70) at _StringValidator.parse (C:..\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:90)
at ModalBuilder.setCustomId (C:..\node_modules\@discordjs\builders\dist\index.js:1538:45)
at InteractionCollector.<anonymous> (C:..\src\cmds\slash\anno[M,ALPHA].js:174:18)
at InteractionCollector.emit (node:events:529:35)
at InteractionCollector.handleCollect (C:.\node_modules\discord.js\src\structures\interfaces\Collector.js:133:14)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
validator: 's.string()',
given: undefined
}
C:..\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:2615
return typeof value === "string" ? Result.ok(value) : Result.err(new ValidationError("s.string()", this.validatorOptions.message ?? "Expected a string primitive", value));
^

ValidationError: Expected a string primitive
at _StringValidator.handle (C:..node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:2615:70) at _StringValidator.parse (C:..\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:90)
at ModalBuilder.setCustomId (C:..\node_modules\@discordjs\builders\dist\index.js:1538:45)
at InteractionCollector.<anonymous> (C:..\src\cmds\slash\anno[M,ALPHA].js:174:18)
at InteractionCollector.emit (node:events:529:35)
at InteractionCollector.handleCollect (C:.\node_modules\discord.js\src\structures\interfaces\Collector.js:133:14)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
validator: 's.string()',
given: undefined
}
An Unnormal Person =)
when the error occurred? like which action caused that error
P H O E T A N I X
P H O E T A N I XOP3mo ago
when i click on author button Set Author
treble/luna
treble/luna3mo ago
You didnt provide a customId for your modal
P H O E T A N I X
P H O E T A N I XOP3mo ago
oh i did
An Unnormal Person =)
double check the customId
P H O E T A N I X
P H O E T A N I XOP3mo ago
...
} else if (i.customId === 'set_author') {
modalTitle = 'Set Author';
customId = 'modal_author';
inputLabel = 'Enter author name:';
placeholder = 'Author Name';
} else if (i.customId === 'set_author_icon') {
modalTitle = 'Set Author Icon';
customId = 'modal_author_icon';
inputLabel = 'Enter author icon URL:';
placeholder = 'https://example.com/author_icon.png';
} else if (i.customId === 'set_author_url') {
modalTitle = 'Set Author URL';
customId = 'modal_author_url';
inputLabel = 'Enter author URL:';
placeholder = 'https://example.com';
...
...
} else if (i.customId === 'set_author') {
modalTitle = 'Set Author';
customId = 'modal_author';
inputLabel = 'Enter author name:';
placeholder = 'Author Name';
} else if (i.customId === 'set_author_icon') {
modalTitle = 'Set Author Icon';
customId = 'modal_author_icon';
inputLabel = 'Enter author icon URL:';
placeholder = 'https://example.com/author_icon.png';
} else if (i.customId === 'set_author_url') {
modalTitle = 'Set Author URL';
customId = 'modal_author_url';
inputLabel = 'Enter author URL:';
placeholder = 'https://example.com';
...
treble/luna
treble/luna3mo ago
And how are you building the modal
P H O E T A N I X
P H O E T A N I XOP3mo ago
ok i fixed now the other problem is that the timestamp wont update after set to true in the preview
An Unnormal Person =)
hmm what caused the problem? you passed the return before updating the message
P H O E T A N I X
P H O E T A N I XOP3mo ago
actually in my code it seems to have 3 different modal handler.... for preview updates and so on. I one of them were missing the customId :monkaStop: ty wait where
An Unnormal Person =)
it only updates the embed data, not the message itself via api
P H O E T A N I X
P H O E T A N I XOP3mo ago
ohh ok tysm! now i get error
An Unnormal Person =)
damn
P H O E T A N I X
P H O E T A N I XOP3mo ago
C:..\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:2615
return typeof value === "string" ? Result.ok(value) : Result.err(new ValidationError("s.string()", this.validatorOptions.message ?? "Expected a string primitive", value));
^

ValidationError: Expected a string primitive
at _StringValidator.handle (C:..\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:2615:70)
at _StringValidator.parse (C:..\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:90)
at ModalBuilder.setCustomId (C:..\node_modules\@discordjs\builders\dist\index.js:1538:45)
at InteractionCollector.<anonymous> (C:..\src\cmds\slash\anno[M,ALPHA].js:178:18)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
validator: 's.string()',
given: undefined
}
C:..\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:2615
return typeof value === "string" ? Result.ok(value) : Result.err(new ValidationError("s.string()", this.validatorOptions.message ?? "Expected a string primitive", value));
^

ValidationError: Expected a string primitive
at _StringValidator.handle (C:..\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:2615:70)
at _StringValidator.parse (C:..\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:90)
at ModalBuilder.setCustomId (C:..\node_modules\@discordjs\builders\dist\index.js:1538:45)
at InteractionCollector.<anonymous> (C:..\src\cmds\slash\anno[M,ALPHA].js:178:18)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
validator: 's.string()',
given: undefined
}
happens when i want to toggle timestamp
An Unnormal Person =)
it's the modal thing again double check the ModalBuilders in your code
P H O E T A N I X
P H O E T A N I XOP3mo ago
:bidenW: sorry im bad at error reading ah the problem is the return; i removed i can just add an else and return?
An Unnormal Person =)
ah yes idk, the current code is not okay since you handled the customId in multiple places, you should handle for them at once and filter which will be run
P H O E T A N I X
P H O E T A N I XOP3mo ago
yeh actually this is not my code. I need to read it precisely when im home and optimise it it just need to work rn
An Unnormal Person =)
i don't think you want to pass another update message function but it's the only fix for now
P H O E T A N I X
P H O E T A N I XOP3mo ago
wym?
An Unnormal Person =)
as I said, you have to update the message so you have to pass an update function inside that
P H O E T A N I X
P H O E T A N I XOP3mo ago
now set_auther_url doesnt work either :caillou:
An Unnormal Person =)
but you already did one, in modal code. it should be better if you can merge them so it will be cleaner
P H O E T A N I X
P H O E T A N I XOP3mo ago
update yeh that what i will do at home ty

Did you find this page helpful?