Is there a way to prevent fetching information both in the precondition and the command itself?
I need to fetch the same data to resolve a precondition, as I'll need later in the command. Is there a way to prevent fetching this twice?
4 Replies
No, not with preconditions. I was thinking about something like it a while ago but never got the time to work on it and forgot
https://discord.com/channels/737141877803057244/737142774738190377/1024108953577201734
If you want to be really really hacky, you could also attach something to the
interaction
object directly, as that's reused between preconditions and the command
kind of like how you would assign to req
in an expressjs middleware@Lioness100 Ok, thanks!
For the time being I just kinda invented a new 'guard' primitive for myself and am doing things like
👍
you can also make an object which will store the response according to the interaction id and reusing it in your command, and finally remove the entry from the object