api: Add GET Thread Member method

This commit is contained in:
twoscott 2024-02-29 01:09:08 +00:00 committed by Diamond
parent 2703326028
commit 2ec439a63f
1 changed files with 12 additions and 0 deletions

View File

@ -487,6 +487,18 @@ func (c *Client) ThreadMembers(threadID discord.ChannelID) ([]discord.ThreadMemb
return m, c.RequestJSON(&m, "GET", EndpointChannels+threadID.String()+"/thread-members")
}
// ThreadMember returns a thread member for the user ID if the user is a member of the thread.
func (c *Client) ThreadMember(
threadID discord.ChannelID, userID discord.UserID) (*discord.ThreadMember, error) {
var m *discord.ThreadMember
return m, c.RequestJSON(
&m,
"GET",
EndpointChannels+threadID.String()+"/thread-members/"+userID.String(),
)
}
// https://discord.com/developers/docs/resources/guild#list-active-threads-response-body
type ActiveThreads struct {
// Threads are the active threads, ordered by descending ID.