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

feat(Voice): implement support for @discordjs/voice #5402

Merged
merged 13 commits into from
Jun 9, 2021

Conversation

amishshah
Copy link
Member

@amishshah amishshah commented Mar 14, 2021

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

This PR allows for creating adapters that can be used by @discordjs/voice. This PR also removes the existing voice codebase as it will no longer be maintained.

The only voice code that will remain in discord.js will be voice states, which aren't specifically part of the Discord Voice API.

What is @discordjs/voice?

@discordjs/voice is a stand-alone library that implements the Discord Voice API. It aims to offer better stability, performance, and scalability than the existing voice client within Discord.js v12.

Discord.js v13 will remove support for the Voice API, and this functionality can be replaced by installing @discordjs/voice (npm install @discordjs/voice) as an add-on.

Example usage:

const { joinVoiceChannel } = require('@discordjs/voice');

const connection = joinVoiceChannel({
  channelId: channel.id,
  guildId: channel.guild.id,
  adapterCreator: channel.guild.voiceAdapterCreator,
});

How do I update my code to use @discordjs/voice?

@discordjs/voice is nearing its release. If you want to get a head start on migrating your voice code to the library, you should take a look at this PR which shows how to create a music bot with @discordjs/voice and TypeScript - discordjs/voice#107

Status and versioning classification:

  • 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
  • This PR changes the library's interface (methods or parameters added)

src/client/voice/ClientVoiceManager.js Outdated Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
@amishshah amishshah marked this pull request as draft March 15, 2021 08:28
@amishshah
Copy link
Member Author

I'm converting this back to a draft as I want to fix discordjs/voice#78 before adapters are added directly to Discord.js.

@amishshah amishshah marked this pull request as ready for review March 18, 2021 12:03
@iCrawl iCrawl requested a review from vladfrangu April 3, 2021 13:24
@amishshah amishshah marked this pull request as draft April 4, 2021 19:13
@amishshah
Copy link
Member Author

Converting to a draft, need to update the adapter as well as deprecate current Discord.js voice code.

@amishshah amishshah reopened this Jun 8, 2021
@amishshah amishshah marked this pull request as ready for review June 8, 2021 13:33
typings/index.d.ts Outdated Show resolved Hide resolved
src/client/voice/ClientVoiceManager.js Outdated Show resolved Hide resolved
src/client/voice/ClientVoiceManager.js Show resolved Hide resolved
@amishshah amishshah linked an issue Jun 9, 2021 that may be closed by this pull request
@amishshah amishshah linked an issue Jun 9, 2021 that may be closed by this pull request
1 task
@amishshah amishshah linked an issue Jun 9, 2021 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment