diff options
author | Wim <wim@42.be> | 2022-04-25 23:50:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 23:50:10 +0200 |
commit | 67adad3e08fe17d5f7e87468ea47aa76e1662255 (patch) | |
tree | 91314fac90d39254e66ae794decfcd21c10a7b20 /vendor/github.com/bwmarrin/discordgo/wsapi.go | |
parent | 2fca3c756373577eab4e0120ccce62eecc1f5ad8 (diff) | |
download | matterbridge-msglm-67adad3e08fe17d5f7e87468ea47aa76e1662255.tar.gz matterbridge-msglm-67adad3e08fe17d5f7e87468ea47aa76e1662255.tar.bz2 matterbridge-msglm-67adad3e08fe17d5f7e87468ea47aa76e1662255.zip |
Update dependencies (#1813)
Diffstat (limited to 'vendor/github.com/bwmarrin/discordgo/wsapi.go')
-rw-r--r-- | vendor/github.com/bwmarrin/discordgo/wsapi.go | 55 |
1 files changed, 44 insertions, 11 deletions
diff --git a/vendor/github.com/bwmarrin/discordgo/wsapi.go b/vendor/github.com/bwmarrin/discordgo/wsapi.go index f2c228d5..dad3fb98 100644 --- a/vendor/github.com/bwmarrin/discordgo/wsapi.go +++ b/vendor/github.com/bwmarrin/discordgo/wsapi.go @@ -409,10 +409,13 @@ func (s *Session) UpdateStatusComplex(usd UpdateStatusData) (err error) { } type requestGuildMembersData struct { - GuildIDs []string `json:"guild_id"` - Query string `json:"query"` - Limit int `json:"limit"` - Presences bool `json:"presences"` + // TODO: Deprecated. Use string instead of []string + GuildIDs []string `json:"guild_id"` + Query *string `json:"query,omitempty"` + UserIDs *[]string `json:"user_ids,omitempty"` + Limit int `json:"limit"` + Nonce string `json:"nonce,omitempty"` + Presences bool `json:"presences"` } type requestGuildMembersOp struct { @@ -425,29 +428,59 @@ type requestGuildMembersOp struct { // guildID : Single Guild ID to request members of // query : String that username starts with, leave empty to return all members // limit : Max number of items to return, or 0 to request all members matched +// nonce : Nonce to identify the Guild Members Chunk response // presences : Whether to request presences of guild members -func (s *Session) RequestGuildMembers(guildID string, query string, limit int, presences bool) (err error) { +func (s *Session) RequestGuildMembers(guildID, query string, limit int, nonce string, presences bool) error { + return s.RequestGuildMembersBatch([]string{guildID}, query, limit, nonce, presences) +} + +// RequestGuildMembersList requests guild members from the gateway +// The gateway responds with GuildMembersChunk events +// guildID : Single Guild ID to request members of +// userIDs : IDs of users to fetch +// limit : Max number of items to return, or 0 to request all members matched +// nonce : Nonce to identify the Guild Members Chunk response +// presences : Whether to request presences of guild members +func (s *Session) RequestGuildMembersList(guildID string, userIDs []string, limit int, nonce string, presences bool) error { + return s.RequestGuildMembersBatchList([]string{guildID}, userIDs, limit, nonce, presences) +} + +// RequestGuildMembersBatch requests guild members from the gateway +// The gateway responds with GuildMembersChunk events +// guildID : Slice of guild IDs to request members of +// query : String that username starts with, leave empty to return all members +// limit : Max number of items to return, or 0 to request all members matched +// nonce : Nonce to identify the Guild Members Chunk response +// presences : Whether to request presences of guild members +// +// NOTE: this function is deprecated, please use RequestGuildMembers instead +func (s *Session) RequestGuildMembersBatch(guildIDs []string, query string, limit int, nonce string, presences bool) (err error) { data := requestGuildMembersData{ - GuildIDs: []string{guildID}, - Query: query, + GuildIDs: guildIDs, + Query: &query, Limit: limit, + Nonce: nonce, Presences: presences, } err = s.requestGuildMembers(data) return } -// RequestGuildMembersBatch requests guild members from the gateway +// RequestGuildMembersBatchList requests guild members from the gateway // The gateway responds with GuildMembersChunk events // guildID : Slice of guild IDs to request members of -// query : String that username starts with, leave empty to return all members +// userIDs : IDs of users to fetch // limit : Max number of items to return, or 0 to request all members matched +// nonce : Nonce to identify the Guild Members Chunk response // presences : Whether to request presences of guild members -func (s *Session) RequestGuildMembersBatch(guildIDs []string, query string, limit int, presences bool) (err error) { +// +// NOTE: this function is deprecated, please use RequestGuildMembersList instead +func (s *Session) RequestGuildMembersBatchList(guildIDs []string, userIDs []string, limit int, nonce string, presences bool) (err error) { data := requestGuildMembersData{ GuildIDs: guildIDs, - Query: query, + UserIDs: &userIDs, Limit: limit, + Nonce: nonce, Presences: presences, } err = s.requestGuildMembers(data) |