serenity-rs / serenity

A Rust library for the Discord API.
https://discord.gg/serenity-rs
ISC License
4.78k stars 583 forks source link

Implements changes to allow developers more control about event handling #2854

Open TheCataliasTNT2k opened 6 months ago

TheCataliasTNT2k commented 6 months ago

Adds Framework::dispatch_automatically Makes client::dispatch::update_cache_with_event public, so it can be called manually by developers

TheCataliasTNT2k commented 6 months ago

The only thing in this method I really care about, is to get the returned values. I do not really want to copy this function to get the FullEvent objects to use them in my library. If this can be achieved in any other way (while not losing the cache functionality) I am happy.

cheesycod commented 6 months ago

This would be useful for me as well

TheCataliasTNT2k commented 4 months ago

I can not really create a better API, because I need to update the cache. Do you have any suggestions? (I will resolve the conflicts when all changes are approved.)

I dislike update_cache_with_event becoming public, as it's quite internal. If you could make a nicer API for this that doesn't require making internal modules public, that would resolve this.

Already did the rebase (or rather just moved my commits to the new HEAD).

cheesycod commented 4 months ago

Any updates on this?

TheCataliasTNT2k commented 4 months ago

I don't think so 🤷 I am just using a fork which has everything I need, which is rejected by the maintainers.