#Interaction handlers problem

1 messages · Page 1 of 1 (latest)

sleek silo
#

hello, I have a problem when creating modals interaction, always get weird error logs (attachment 2)
I don't know, what should I do?

i need to create some registration sections (which is i copy from djs-docs for testing), when user execute command example: /register
will show the embedded button, the button is fine, inside button(interaction handler) is the modals code (attachment 1)
but when I click submit button, error (attachment 2)

https://cdn.discordapp.com/attachments/718032929825226884/1195818811564232824/image.png?ex=65b5600d&is=65a2eb0d&hm=4b65e082e1d923b7af4c00fbf8614fcfbb937c5eb9e081db318542906d900abd&
https://cdn.discordapp.com/attachments/718032929825226884/1195818880640225370/image.png?ex=65b5601e&is=65a2eb1e&hm=4b6fe4558ed5fe2f5d5c660c5cd10766b8cf163cdc5f21a22c301f1053c7b68d&

shy boltBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

hushed halo
#

You need to implement parse in the internation handler and put the customId filter there. That should fix the error because the error is where we read the result from parse.

https://www.sapphirejs.dev/docs/Guide/interaction-handlers/what-are-they

CC @prime notch way back when you wrote the v4 docs you said it was technically possible to put everything in run but people shouldnt. I fully agree with this statement, but if we want to uphold that it's technically possible to put everything in run then we should check if option is undefined here: https://github.com/sapphiredev/framework/blob/10d03313d7ff1567f753d319dafd8ef88b35de7a/src/lib/structures/InteractionHandlerStore.ts#L33

#

btw you also have an oudated version of @sapphire/framework installed @sleek silo. You seem to have installed v4 when v5 is the latest. I can tell because the path should otherwise be dist/cjs/lib/structures/InteractionHandlerStore.cjs

#

@prime notch line 26 from the stacktrace above is option.match:

sleek silo
hushed halo
shy boltBOT
sleek silo
prime notch
#

we provide a default implementation of parse