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

Issue:
Implement Get Thread Member
https://discord.com/developers/docs/resources/channel#get-thread-member


Discussion / hints:

Fix patch:
diff --git a/src/http/client.rs b/src/http/client.rs
index aabe40dde4a..62c3fcc50fe 100644
--- a/src/http/client.rs
+++ b/src/http/client.rs
@@ -2988,6 +2988,26 @@ impl Http {
         .await
     }
 
+    pub async fn get_thread_channel_member(
+        &self,
+        channel_id: ChannelId,
+        user_id: UserId,
+        with_member: bool,
+    ) -> Result<ThreadMember> {
+        self.fire(Request {
+            body: None,
+            multipart: None,
+            headers: None,
+            method: LightMethod::Get,
+            route: Route::ChannelThreadMember {
+                channel_id,
+                user_id,
+            },
+            params: Some(vec![("with_member", with_member.to_string())]),
+        })
+        .await
+    }
+
     /// Retrieves the webhooks for the given [channel][`GuildChannel`]'s Id.
     ///
     /// This method requires authentication.
diff --git a/src/model/channel/channel_id.rs b/src/model/channel/channel_id.rs
index 7cac4292719..86c44e27d1f 100644
--- a/src/model/channel/channel_id.rs
+++ b/src/model/channel/channel_id.rs
@@ -1007,6 +1007,22 @@ impl ChannelId {
         http.as_ref().remove_thread_channel_member(self, user_id).await
     }
 
+    /// Gets a thread member, if this channel is a thread.
+    ///
+    /// `with_member` controls if ThreadMember::member should be `Some`
+    ///
+    /// # Errors
+    ///
+    /// It may return an [`Error::Http`] if the channel is not a thread channel
+    pub async fn get_thread_member(
+        self,
+        http: impl AsRef<Http>,
+        user_id: UserId,
+        with_member: bool,
+    ) -> Result<ThreadMember> {
+        http.as_ref().get_thread_channel_member(self, user_id, with_member).await
+    }
+
     /// Gets private archived threads of a channel.
     ///
     /// # Errors


Test patch: