Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(models): add "flags" field to MemberUpdate payload #2265

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions twilight-model/src/gateway/payload/incoming/member_update.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use crate::{

Check failure on line 1 in twilight-model/src/gateway/payload/incoming/member_update.rs

View workflow job for this annotation

GitHub Actions / Format

Diff in /home/runner/work/twilight/twilight/twilight-model/src/gateway/payload/incoming/member_update.rs
id::{
marker::{GuildMarker, RoleMarker},
Id,
},

Check failure on line 5 in twilight-model/src/gateway/payload/incoming/member_update.rs

View workflow job for this annotation

GitHub Actions / Format

Diff in /home/runner/work/twilight/twilight/twilight-model/src/gateway/payload/incoming/member_update.rs
user::User,
util::{ImageHash, Timestamp},
guild::MemberFlags,
};
use serde::{Deserialize, Serialize};

Expand All @@ -14,6 +15,7 @@
pub avatar: Option<ImageHash>,
pub communication_disabled_until: Option<Timestamp>,
pub guild_id: Id<GuildMarker>,
pub flags: MemberFlags,
pub deaf: Option<bool>,
pub joined_at: Timestamp,
pub mute: Option<bool>,
Expand All @@ -34,10 +36,10 @@
pub user: User,
}

#[cfg(test)]

Check failure on line 39 in twilight-model/src/gateway/payload/incoming/member_update.rs

View workflow job for this annotation

GitHub Actions / Format

Diff in /home/runner/work/twilight/twilight/twilight-model/src/gateway/payload/incoming/member_update.rs
mod tests {
use super::MemberUpdate;
use crate::{id::Id, test::image_hash, user::User, util::Timestamp};
use crate::{id::Id, test::image_hash, user::User, util::Timestamp, guild::MemberFlags};
use serde_test::Token;

#[test]
Expand All @@ -50,6 +52,7 @@
avatar: None,
communication_disabled_until: Some(communication_disabled_until),
guild_id: Id::new(1_234),
flags: MemberFlags::empty(),
deaf: Some(false),
joined_at,
mute: Some(false),
Expand Down Expand Up @@ -83,7 +86,7 @@
&[
Token::Struct {
name: "MemberUpdate",
len: 11,
len: 12,
},
Token::Str("avatar"),
Token::None,
Expand All @@ -93,6 +96,8 @@
Token::Str("guild_id"),
Token::NewtypeStruct { name: "Id" },
Token::Str("1234"),
Token::Str("flags"),
Token::U64(0),
Token::Str("deaf"),
Token::Some,
Token::Bool(false),
Expand Down
Loading