d4n3436 / Fergun.Interactive

An addon that provides interactive functionality to Discord commands.
MIT License
31 stars 5 forks source link

Add REST-based interaction handling #8

Open d4n3436 opened 2 years ago

d4n3436 commented 2 years ago

~Waiting for a new Discord.Net Labs release to work on it.~

Related: https://github.com/Discord-Net-Labs/Discord.Net-Labs/commit/32f5661a94d485c7e570043ea81ece0afb4c0441

d4n3436 commented 2 years ago

Any update on this?

@TheStachelfisch you deleted your comment but I will answer it anyway:

REST/HTTP interactions are complex, supporting it implies changing the methods and internal callbacks to support IDiscordInteraction and IComponentInteraction, plus a new delegate for responding REST interactions has to be added.

I've finished adapting the library to support REST interactions, but I have not tested it yet. I need some feedback/opinions on the way of handling the REST interactions. Currently, the lib uses a callback from the config (RestResponseCallback), which is called when responding/deferring incoming interactions from InteractiveService.HandleRestInteractionAsync, but I'm not sure if this design is the best for this case.

REST interactions branch: https://github.com/d4n3436/Fergun.Interactive/tree/rest-interactions

Feel free to leave any feedback here.