-
-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReceivedGatewayEvent #2868
Comments
Hello! Could you better describe your usecase? |
Thank you for the quick answer! I want to catch all incoming messages from the gateway for debug purposes, better understand of the API, and other stuff. currently this is not possible:
I created a solution to my problem with reflection to be able to add my own message processor to ReceivedGatewayEvent:
You could easily expose a simple event on DiscordSocketClient, with the following parameters and invoke this event in DiscordSocketClient.ProcessMessageAsync. |
Hm |
one more comment: in Discord.Net.Rest, all model classes are internal. That would be extremely helpful to change them to be public. example: using Newtonsoft.Json;
In this case, we could add low-level gateway message processing via the endpoint requested above, serializing the JToken to the corresponding model, similarly to what DiscordSocketClient.ProcessMessageAsync I know these are edge-cases, but I can only repeat myself, they would be very useful for advanced processing. Thank in advance! |
Yeah, that is planned in v4. All json models will be public |
Hello!
It would be awesome to be able to access DiscordSocketClient.ApiClient, or at least expose an event which gets all events currently handled by DiscordSocketClient.ProcessMessageAsync.
Because everything is internal instead of being protected, I cannot solve this issue without forking Discord.Net.
I will try to add my own ReceivedGatewayEvent eventhandler with reflection to the internal ApiClient property, but even if it works, well, you know... not the best solution. Even the GatewayOpCode enum is internal...
PS: this project is a gemstone of github, congratulations!
The text was updated successfully, but these errors were encountered: