1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-01-08 04:57:31 +00:00

gateway: Fix RequestGuildMembersCommand.GuildIDs

This commit is contained in:
diamondburned 2022-10-03 04:48:50 -07:00
parent d97492348d
commit d952c98829
No known key found for this signature in database
GPG key ID: D78C4471CE776659
2 changed files with 6 additions and 4 deletions

View file

@ -77,7 +77,9 @@ type InvalidSessionEvent bool
type RequestGuildMembersCommand struct { type RequestGuildMembersCommand struct {
// GuildIDs contains the IDs of the guilds to request data from. Multiple // GuildIDs contains the IDs of the guilds to request data from. Multiple
// guilds can only be requested when using user accounts. // guilds can only be requested when using user accounts.
GuildIDs []discord.GuildID `json:"guild_ids"` //
// The guild_id JSON key is intentional, despite the type being an array.
GuildIDs []discord.GuildID `json:"guild_id"`
// UserIDs contains the IDs of the users to request data for. If this is // UserIDs contains the IDs of the users to request data for. If this is
// filled, then the Query field must be empty. // filled, then the Query field must be empty.

View file

@ -36,7 +36,7 @@ func TestRequestGuildMembersCommand(t *testing.T) {
} }
assert(&cmd, map[string]interface{}{ assert(&cmd, map[string]interface{}{
"guild_ids": []interface{}{"123"}, "guild_id": []interface{}{"123"},
"user_ids": []interface{}{"456"}, "user_ids": []interface{}{"456"},
"presences": false, "presences": false,
}) })
@ -49,7 +49,7 @@ func TestRequestGuildMembersCommand(t *testing.T) {
} }
assert(&cmd, map[string]interface{}{ assert(&cmd, map[string]interface{}{
"guild_ids": []interface{}{"123"}, "guild_id": []interface{}{"123"},
"query": "", "query": "",
"limit": float64(0), "limit": float64(0),
"presences": false, "presences": false,
@ -63,7 +63,7 @@ func TestRequestGuildMembersCommand(t *testing.T) {
} }
assert(&cmd, map[string]interface{}{ assert(&cmd, map[string]interface{}{
"guild_ids": []interface{}{"123"}, "guild_id": []interface{}{"123"},
"query": "abc", "query": "abc",
"limit": float64(0), "limit": float64(0),
"presences": false, "presences": false,