Repository: serenity-rs/serenity (language: rust)

Issue:
serenity's TeamMember doesn't line up with discord's TeamMember
https://docs.rs/serenity/latest/serenity/model/application/struct.TeamMember.html
https://discord.com/developers/docs/topics/teams#data-models-team-member-object

The role is missing in serenity, and permission doesn't exist anymore in discord's docs.

Additionally the Team Member Role Types should also probably be modeled in some way?
https://discord.com/developers/docs/topics/teams#team-member-roles-team-member-role-types


Discussion / hints:

Fix patch:
diff --git a/src/model/application/mod.rs b/src/model/application/mod.rs
index 4f8a0a51686..5b00a747acb 100644
--- a/src/model/application/mod.rs
+++ b/src/model/application/mod.rs
@@ -107,11 +107,14 @@ pub struct TeamMember {
     /// The list of permissions of the member on the team.
     ///
     /// NOTE: Will always be "*" for now.
+    #[deprecated = "This field is not sent by the API anymore"]
     pub permissions: Vec<String>,
     /// The ID of the team they are a member of.
     pub team_id: GenericId,
     /// The user type of the team member.
     pub user: User,
+    /// The [`TeamMemberRole`] of the team member.
+    pub role: TeamMemberRole,
 }
 
 enum_number! {
@@ -126,6 +129,17 @@ enum_number! {
     }
 }
 
+#[derive(Clone, Debug, Deserialize, Serialize)]
+#[serde(rename_all = "snake_case")]
+#[non_exhaustive]
+pub enum TeamMemberRole {
+    Admin,
+    Developer,
+    ReadOnly,
+    #[serde(untagged)]
+    Other(String),
+}
+
 bitflags! {
     /// The flags of the application.
     ///


Test patch: