I'm pretty new to rust so this question might not necessarily belong here, but any help would be appreciated regardless.
I'm currently receiving some BSON data that I'd like to turn into a struct that I can modify, so currently I'm using twilight-model and serde_json for this.
let bson = bson::Bson::try_from(message.data.clone())?;
let data: twilight_model::gateway::payload::incoming::MessageCreate =
serde_json::from_value(bson.into())?;
This gives me the following error: Error: missing field 'flags'
However, MessageCreate.flags is an Option, shouldn't that mean that even if it's missing, it should be able to parse the rest anyways? Is serde_json the right tool for this, or does twilight have it's own tools to serialize data like this. If not, what am I supposed to change to make this work?