Refactor data models
-
Commands -
Events
enum Event {
Ready(ReadyEventData),
...
}
enum Command {
SetActivity(serde_json::Value),
...
}
This might require some custom serialization/deserialization with Serde.
Event data should be a fixed struct, because they are consumed by the end user through event handler context.
Command arguments can stay as serde_json::Value
, they are just built and sent to the Discord client.
Commands also get echoed back when sent.
Edited by Patrick Auernig