1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-27 09:12:53 +00:00

api: allow searching DMs

This commit is contained in:
Samuel Hernandez 2024-07-13 15:41:31 -04:00 committed by Diamond
parent 0ec9fe5ace
commit 231b4759dc

View file

@ -35,3 +35,15 @@ func (c *Client) Search(guildID discord.GuildID, data SearchData) (SearchRespons
httputil.WithSchema(c, data), 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),
)
}