Whilst discussing #2110 in Discord (https://discord.com/channels/745809834183753828/1070716906098671706) it came up that Discord no longer documents the AuditLogChange variants. We should therefore, as usually, remove the variants ourselves too, transforming it into a struct where new_value and old_value can be of any type.
I can think of three ways to achieve this:
- Expose the values as
serde_json::Value or simd_json::value::owned::Value. Downside: new feature flags for twilight-model.
- Expose the values as
serde_value::Value (which is already a dependency). Downside: awkward to use for users.
- Expose the values as raw JSON (of type
String) by deserializing and reserializing them back to strings (trickier than it seems to optimize out). This is what Remora does, as can be seen here Remora/Remora.Discord@ddb3ddb.
Whilst discussing #2110 in Discord (https://discord.com/channels/745809834183753828/1070716906098671706) it came up that Discord no longer documents the
AuditLogChangevariants. We should therefore, as usually, remove the variants ourselves too, transforming it into a struct wherenew_valueandold_valuecan be of any type.I can think of three ways to achieve this:
serde_json::Valueorsimd_json::value::owned::Value. Downside: new feature flags for twilight-model.serde_value::Value(which is already a dependency). Downside: awkward to use for users.String) by deserializing and reserializing them back to strings (trickier than it seems to optimize out). This is what Remora does, as can be seen here Remora/Remora.Discord@ddb3ddb.