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

Handle MessageDeleteBulk event #304

Merged
merged 4 commits into from
Dec 28, 2016
Merged

Conversation

jogramming
Copy link
Contributor

No description provided.

case *MessageDeleteBulk:
if s.MaxMessageCount != 0 {
for _, mID := range t.Messages {
s.MessageRemove(&Message{ID: mID, ChannelID: t.ChannelID})
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we changed MessageRemove to call messageRemoveById() this could be modified to not create a bunch of junk data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

o7

@@ -519,12 +519,12 @@ func (s *State) MessageAdd(message *Message) error {
}

// MessageRemove removes a message from the world state.
func (s *State) MessageRemove(message *Message) error {
func (s *State) MessageRemove(channelID, messageID string) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Arghh sorry to be a butthole dude. But I didn't want to change the existing API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh woops i misread what you wrote, sorry

}

// messageRemoveById removes a message by channelID and messageID from the world state.
func (s *State) messageRemoveById(channelID, messageID string) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

lint is complaining this should be: messageRemoveByID

@iopred iopred merged commit 6fd8019 into bwmarrin:develop Dec 28, 2016
@bwmarrin bwmarrin added this to the v0.16.0 milestone Apr 18, 2017
ErikMcClure pushed a commit to ErikMcClure/discordgo that referenced this pull request Aug 4, 2020
* Handle MessageDeleteBulk event

* Changed State.MessageRemove to use id's

* Revert State.MessageRemove change and add State.messageRemoveById

* Fix linting
@ashishjh-bst ashishjh-bst deleted the bulk-del-evt branch March 21, 2022 12:49
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.

None yet

3 participants