Skip to content

Commit

Permalink
chore(model)!: mark StickerPack.banner_asset_id optional (#1337)
Browse files Browse the repository at this point in the history
  • Loading branch information
vilgotf authored Dec 18, 2021
1 parent 16c70d5 commit c4a708d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion model/src/channel/message/sticker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! See the [Discord documentation] for more information.
//!
//! [Discord documentation]: https://discord.com/developers/docs/resources/channel#message-object-message-sticker-structure
//! [Discord documentation]: https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-structure
mod format_type;
mod id;
Expand Down
7 changes: 5 additions & 2 deletions model/src/channel/message/sticker/pack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub struct StickerPack {
/// ID of the sticker pack's banner image.
pub banner_asset_id: StickerBannerAssetId,
pub banner_asset_id: Option<StickerBannerAssetId>,
/// ID of the sticker that is shown as the pack's icon.
pub cover_sticker_id: Option<StickerId>,
/// Description of the sticker pack.
Expand Down Expand Up @@ -58,7 +58,9 @@ mod tests {
#[test]
fn test_full() {
let value = StickerPack {
banner_asset_id: StickerBannerAssetId::new(761_773_777_976_819_732).expect("non zero"),
banner_asset_id: Some(
StickerBannerAssetId::new(761_773_777_976_819_732).expect("non zero"),
),
cover_sticker_id: Some(StickerId::new(749_053_689_419_006_003).expect("non zero")),
description: "Say hello to Wumpus!".into(),
id: StickerPackId::new(847_199_849_233_514_549).expect("non zero"),
Expand Down Expand Up @@ -87,6 +89,7 @@ mod tests {
len: 7,
},
Token::Str("banner_asset_id"),
Token::Some,
Token::NewtypeStruct {
name: "StickerBannerAssetId",
},
Expand Down

0 comments on commit c4a708d

Please sign in to comment.