How can I partition custom id schemas using `@sapphire/string-store`
I created 2 different schema stores, where each store keeps track of schemas for a particular feature of the bot. I then use the
parse
method of interaction handlers to determine whether a given interaction should be handled by it, as such:
And in another handler, deserializing using a different schema store:
Since both enums hold the same integer value, both of these handlers are executed, which is not what I am trying to achieve. I am wondering if I need to use a single schema store for each type of interaction (button/select menu/etc) or if there is any way I could categorize/partition them1 Reply
Another idea would be to actually give values to enum members rather than letting them default to integers but then I would have to make sure they are unique between stores (could just add a unique prefix to all of each store's enum members but it's a bit ugly 🙁 )
Adding an id property to the schemas themselves that identified it would be an option too, but not ideal either