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

Fix(Structure): Message#delete() cause event messageDelete to fires twice #3252

Merged
merged 4 commits into from Aug 17, 2019
Merged

Fix(Structure): Message#delete() cause event messageDelete to fires twice #3252

merged 4 commits into from Aug 17, 2019

Conversation

KhooHaoYit
Copy link
Contributor

@KhooHaoYit KhooHaoYit commented May 6, 2019

The PR #3250 should be merged before this PR
Please describe the changes this PR makes and why it should be merged:
When a message was deleted using the method Message#delete(), the MessageDelete action handler was executed by it.
After that, the MessageDelete action handler got executed again by the WebSocketManager.
Causing double emission.

The same problem can be found in TextBasedChannel#bulkDelete() but I was unable to fix it due to lack of time.

Status

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

@SpaceEEC SpaceEEC merged commit 8ae7a30 into discordjs:master Aug 17, 2019
samsamson33 pushed a commit to samsamson33/discord.js that referenced this pull request Feb 27, 2020
…iscordjs#3252)

* ref: add getPayload and use for other get* methods

* return existing data.*

* use Action.getUser()

* Fix messageDelete double emission
samsamson33 added a commit to samsamson33/discord.js that referenced this pull request Feb 27, 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.

None yet

5 participants