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

Typings: VoiceConnection.dispatcher has wrong type #5205

Closed
1 task done
lasa01 opened this issue Jan 11, 2021 · 0 comments · Fixed by #5217
Closed
1 task done

Typings: VoiceConnection.dispatcher has wrong type #5205

lasa01 opened this issue Jan 11, 2021 · 0 comments · Fixed by #5217

Comments

@lasa01
Copy link

lasa01 commented Jan 11, 2021

Please describe the problem you are having in as much detail as possible:
The TypeScript type definitions have incorrect type for VoiceConnection.dispatcher. In the documentation, the type is ?StreamDispatcher (nullable) while in the type definitons it is defined as StreamDispatcher (can't be null). When the bot is connected into a voice channel, but is not playing anything, the VoiceConnection.dispatcher is null.

Include a reproducible code sample here, if possible:

const discord = require("discord.js");
const client = new discord.Client();
await client.login(token);
const guild = client.guilds.cache.first();
const voiceChannel = guild.channels.cache.find((channel) => channel.type === "voice");
const connection = await voiceChannel.join();
connection.dispatcher === null

Further details:

  • discord.js version: 12.5.1
  • Node.js version: 14.15.0
  • Operating system: Windows
  • Priority this issue should have – please be realistic and elaborate if possible: not critical, but it's easy to fix

Relevant client options:

  • partials: none
  • gateway intents: none
  • other: none
  • I have also tested the issue on latest master, commit hash: c4c8171
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants