Skip to content

Commit

Permalink
api: allow searching DMs
Browse files Browse the repository at this point in the history
  • Loading branch information
samhza authored and diamondburned committed Jul 14, 2024
1 parent 0ec9fe5 commit 231b475
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,15 @@ func (c *Client) Search(guildID discord.GuildID, data SearchData) (SearchRespons
httputil.WithSchema(c, data),
)
}

// SearchDirectMessages searches through a direct message channel.
// SearchData.ChannelID must be a valid channel ID.
func (c *Client) SearchDirectMessages(data SearchData) (SearchResponse, error) {
var resp SearchResponse

return resp, c.RequestJSON(
&resp, "GET",
EndpointChannels+data.ChannelID.String()+"/messages/search",
httputil.WithSchema(c, data),
)
}

0 comments on commit 231b475

Please sign in to comment.