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 end method in VoiceBroadcast #3194

Merged
merged 3 commits into from
Apr 11, 2019
Merged

Conversation

thomasxd24
Copy link
Contributor

@thomasxd24 thomasxd24 commented Apr 9, 2019

this.client is a ClientVoiceManager and thus its this.client.broadcasts instead of this.client.voice.broascasts

Please describe the changes this PR makes and why it should be merged:

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.

this.client is a ClientVoiceManager and thus its this.client.broadcasts  instead of this.client.voice.broascasts
@@ -67,8 +67,8 @@ class VoiceBroadcast extends EventEmitter {
*/
end() {
for (const dispatcher of this.dispatchers) this.delete(dispatcher);
const index = this.client.voice.broadcasts.indexOf(this);
if (index !== -1) this.client.voice.broadcasts.splice(index, 1);
const index = this.client.broadcasts.indexOf(this);
Copy link
Member

Choose a reason for hiding this comment

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

Can you rename the client variable to voiceManager, including updating the jsdocs in the constructor? That way it's correctly showing what it is

Copy link
Member

Choose a reason for hiding this comment

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

Or pass client when constructing VoiceBroadcast:

const broadcast = new VoiceBroadcast(this);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think its better to pass the client

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just change the pull to change the this.client
const broadcast = new VoiceBroadcast(this.client);

@amishshah amishshah merged commit 8da1416 into discordjs:master Apr 11, 2019
@thomasxd24 thomasxd24 deleted the patch-1 branch April 15, 2019 11:28
samsamson33 pushed a commit to samsamson33/discord.js that referenced this pull request Feb 27, 2020
* fix end method in VoiceBroadcast

this.client is a ClientVoiceManager and thus its this.client.broadcasts  instead of this.client.voice.broascasts

* revert the voicebroadcast and pass this.client at clientvoice

* passed this.client
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.

4 participants