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

Bulk delete #199

Merged
merged 5 commits into from
May 14, 2016
Merged

Bulk delete #199

merged 5 commits into from
May 14, 2016

Conversation

VagantemNumen
Copy link
Contributor

Added bulk delete endpoint and bulk delete support.

Requires a channelID and a slice of messageIDs from the channel.
If only on ID is in the slice calls ChannelMessageDelete() internally.
If the slice of IDs is empty do nothing.
Requires a channelID and a slice of messageIDs from the channel.
If only on ID is in the slice calls ChannelMessageDelete() internally.
If the slice of IDs is empty do nothing.
Noted maximum of 100 messageIDs in the comment.
If more than 100 is present send the first 100 in the request and
ignore the rest.
}

if len(messages) > 100 {
messages = messages[:100]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps you could call bulk delete multiple times for each group of 100 messages?

Copy link
Contributor Author

@VagantemNumen VagantemNumen May 14, 2016

Choose a reason for hiding this comment

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

This is why I did not do it like that,

warn This endpoint has a rate limit of 1 request per second per guild, and is limited 
to 100 messages per request. 
The request will fail if less than two snowflakes are provided. 
Only bot accounts can use this endpoint.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice, Looks good to me!

@bwmarrin bwmarrin added this to the v0.13.0 milestone May 14, 2016
@bwmarrin bwmarrin added the feature Major feature implementation label May 14, 2016
@bwmarrin
Copy link
Owner

Great job @VagantemNumen and thanks a lot for the help! I really appreciate it!

@bwmarrin bwmarrin merged commit 7d1ed7c into bwmarrin:develop May 14, 2016
alex-j-butler pushed a commit to alex-j-butler/discordgo that referenced this pull request Nov 5, 2016
@VagantemNumen VagantemNumen deleted the bulk-delete branch November 7, 2016 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Major feature implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants