Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Batch Request Guild Members #709

Merged
merged 10 commits into from
Dec 28, 2019

Conversation

mistahj67
Copy link
Contributor

This is supported by the Discord API and will save requests.

This is supported by the Discord API and will save requests.
@Bios-Marcel
Copy link

This is backwards compatibility breaking change. I'd suggest adding a new function.

@mistahj67
Copy link
Contributor Author

mistahj67 commented Oct 26, 2019

Updated to eliminate breaking backwards compatibility issue

wsapi.go Outdated
Comment on lines 401 to 406
type requestGuildMembersData struct {
GuildID []string `json:"guild_id"`
Query string `json:"query"`
Limit int `json:"limit"`
GuildID string `json:"guild_id"`
GuildIDs []string `json:"guild_id"`
Query string `json:"query"`
Limit int `json:"limit"`
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can leave the struct the same as before so:

type requestGuildMembersData struct {
	GuildID []string `json:"guild_id"`
	Query   string   `json:"query"`
	Limit   int      `json:"limit"`
}

And then pass the argument in the original function to the slice.

wsapi.go Outdated Show resolved Hide resolved
wsapi.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@CarsonHoffman CarsonHoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the PR!

@CarsonHoffman CarsonHoffman merged commit 431f16e into bwmarrin:develop Dec 28, 2019
@mistahj67 mistahj67 deleted the BatchRequestGuildMembers branch January 12, 2020 04:11
mistahj67 added a commit to warmind-io/discordgo that referenced this pull request Jan 12, 2020
mistahj67 added a commit to warmind-io/discordgo that referenced this pull request May 10, 2020
@CarsonHoffman CarsonHoffman added this to the v0.21.0 milestone Jun 21, 2020
ErikMcClure pushed a commit to ErikMcClure/discordgo that referenced this pull request Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants