mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-12-11 06:26:35 +00:00
Compare commits
3 commits
5287f0c177
...
7705eda93a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7705eda93a | ||
|
|
a891a653eb | ||
|
|
43b5c9dcad |
|
|
@ -644,3 +644,59 @@ func (c *Client) JoinedPrivateArchivedThreadsBefore(
|
|||
before discord.Timestamp, limit uint) (*ArchivedThreads, error) {
|
||||
return c.JoinedPrivateArchivedThreads(channelID, before, limit)
|
||||
}
|
||||
|
||||
type ThreadTagSetting string
|
||||
|
||||
const (
|
||||
MatchSome ThreadTagSetting = "match_some"
|
||||
MatchAll ThreadTagSetting = "all"
|
||||
)
|
||||
|
||||
type ThreadSortBy string
|
||||
|
||||
const (
|
||||
LastMessageTime ThreadSortBy = "last_message_time"
|
||||
ArchiveTime ThreadSortBy = "archive_time"
|
||||
Relevance ThreadSortBy = "relevance"
|
||||
CreationTime ThreadSortBy = "creation_time"
|
||||
)
|
||||
|
||||
type ThreadSortOrder string
|
||||
|
||||
const (
|
||||
SortAscending ThreadSortOrder = "asc"
|
||||
SortDescending ThreadSortOrder = "desc"
|
||||
)
|
||||
|
||||
type (
|
||||
SearchThreadsData struct {
|
||||
Name string `schema:"name,omitempty"`
|
||||
Slop int `schema:"slop,omitempty"`
|
||||
Tag []discord.Snowflake `schema:"tag,omitempty"`
|
||||
TagSetting ThreadTagSetting `schema:"tag_setting,omitempty"`
|
||||
Archived bool `schema:"archived,omitempty"`
|
||||
SortOrder ThreadSortOrder `schema:"sort_order,omitempty"`
|
||||
SortBy ThreadSortBy `schema:"sort_by,omitempty"`
|
||||
Limit int `schema:"limit,omitempty"`
|
||||
MaxID discord.Snowflake `schema:"max_id,omitempty"`
|
||||
MinID discord.Snowflake `schema:"min_id,omitempty"`
|
||||
Offset int `schema:"offset,omitempty"`
|
||||
}
|
||||
|
||||
SearchThreadsResponse struct {
|
||||
Threads []discord.Channel `json:"threads"`
|
||||
Members []discord.ThreadMember `json:"members"`
|
||||
HasMore bool `json:"has_more"`
|
||||
TotalResults int `json:"total_results"`
|
||||
FirstMessages []discord.Message `json:"first_messages,omitempty"`
|
||||
}
|
||||
)
|
||||
|
||||
func (c *Client) SearchThreads(channelID discord.ChannelID, data SearchThreadsData) (SearchThreadsResponse, error) {
|
||||
var resp SearchThreadsResponse
|
||||
return resp, c.RequestJSON(
|
||||
&resp, "GET",
|
||||
EndpointChannels+channelID.String()+"/threads/search",
|
||||
httputil.WithSchema(c, data),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue