Interaction Handlers & "Button is not for you" response

Hi! My problem is: I have a bunch of buttons that implemented like interaction handlers, and my goal is simple - I want to respond to a user with "This button is not for you" if "parse" method fails. But I can't do that because if I respond to 1 handlers, others will break with "interaction already replied". Is there any sort of and event if sapphire couldn't find any parse method that will work so I can response with my message? Another solution I think of is just respond with any handler, and before responding check if interaction is replied. If it is - do nothing, but then - we need to handle replied interaction in our "run" method. Tbh adding this small feature feels like a pain so I don't even know if I wanna do that if there is no simple solution :D
Solution:
Truth be told I would advice against it anyway because it goes principally against how Discord tells us to use interactions. Interactions should only be replied to once. The only consistent way to achieve this is to use something like discordjs' awaitComponents where you can user filter instead of sappire handlers. An example of this can be seen in PaginatedMessage i.e.e from @Dragonite
Jump to solution
2 Replies
Solution
Favna
Favna2w ago
Truth be told I would advice against it anyway because it goes principally against how Discord tells us to use interactions. Interactions should only be replied to once. The only consistent way to achieve this is to use something like discordjs' awaitComponents where you can user filter instead of sappire handlers. An example of this can be seen in PaginatedMessage i.e.e from @Dragonite
secre
secreOP2w ago
I see, thanks for your reply!

Did you find this page helpful?