Possible to intercept a request to modify the payload?
If your application has several commands but needs some kind of notice attached to the response (like a embed with some info) you'd have to add it to every response manually. But is it possible to intercept the request payload for X type and modify it?
In my case I have the command markdown
</slash command:id>
in several commands but I can't hardcode it as the ID changes whenever you update a command. So I just cache all the command IDs on load, but then I'd still have to format it in every single response. Instead I'd like to just intercept the request and format it in one function than every command I have or will add.5 Replies
You could implement your own RequestHandler
Are there any docs on that?
I see
dev.kord.rest.request.RequestHandler
but I have no idea how to use itwouldn't it be possible to extract the logic into a simple function to use instead of kord's response function?
yeah but then you have to make sure you use it every time it needs to be
hm, fair. but requesthandler seems to be too low level for your purposes