Skip to content

Commit

Permalink
skip serializing if avatar does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
AsianIntel committed Feb 4, 2025
1 parent 979766b commit 4048259
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rowifi_models/src/discord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub mod cache {
pub roles: Vec<RoleId>,
pub nickname: Option<String>,
pub id: UserId,
#[serde(skip_serializing_if = "Option::is_none", default)]
/// The guild specific avatar
pub avatar: Option<ImageHash>,
}
Expand All @@ -49,6 +50,7 @@ pub mod cache {
pub struct CachedUser {
pub id: UserId,
pub username: String,
#[serde(skip_serializing_if = "Option::is_none", default)]
/// The global user avatar
pub avatar: Option<ImageHash>,
}
Expand Down

0 comments on commit 4048259

Please sign in to comment.