You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
As an alternative to serde_json::Value, serde_json::value::RawValue could be used instead. Potentially hidden and only accessible through a str reference getter method.
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 wherenew_value
andold_value
can be of any type.I can think of three ways to achieve this:
serde_json::Value
orsimd_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.The text was updated successfully, but these errors were encountered: