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

@discordjs/voice example is incorrect #2

Open
mstan opened this issue Jun 5, 2022 · 0 comments
Open

@discordjs/voice example is incorrect #2

mstan opened this issue Jun 5, 2022 · 0 comments
Labels
bug Something isn't working need repro

Comments

@mstan
Copy link

mstan commented Jun 5, 2022

Which package is this bug report for?

voice

Issue description

See:

connection.subscribe(player);

ISSUE: Bot will never begin playing audio because the "player" object will never emit 'stateChange'

PERCEIVED CAUSE: A state change is not being emitted until "player.play()" is called, which will emit the stateChange event that performs "attachRecorder()".

In the example, the following code is as follows:

const connection = await connectToChannel(channel);
connection.subscribe(player);
await message.reply('Playing now!');

Although a subscription is added, that in itself is not enough to emit a state change or cause the player to begin playing. In the example, following connection.subscribe(player), a new line with "player.play()" should be added.

Code sample

No response

Package version

v13.7

Node.js version

16.12

Operating system

Windows

Priority this issue should have

Medium (should be fixed soon)

Which partials do you have configured?

Not applicable (subpackage bug)

Which gateway intents are you subscribing to?

Not applicable (subpackage bug)

I have tested this issue on a development release

No response

@mstan mstan added bug Something isn't working need repro labels Jun 5, 2022
@SpaceEEC SpaceEEC transferred this issue from discordjs/discord.js Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need repro
Projects
None yet
Development

No branches or pull requests

1 participant