Getting voice adapter with @discordjs/core
I'm getting an issue with @discordjs/core and @discordjs/voice where it needs an adapter to join a voice channel. So I find out that it relates to the guild but using
client.api.guilds.get(guildid)
doesn't contain the adapter. How would I get the adapter using @discordjs/core or is it impossible?13 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Not using discord.js, using @discordjs/ binaries
Here is my code:
You would need to roll your own implementation of it:
- https://discord.js.org/docs/packages/voice/main/DiscordGatewayAdapterCreator:TypeAlias
- https://discord.js.org/docs/packages/voice/main/DiscordGatewayAdapterImplementerMethods:Interface
- https://discord.js.org/docs/packages/voice/main/DiscordGatewayAdapterLibraryMethods:Interface
Is there any examples of this around I can take a peak at?
You could take a look at how discord.js does it:
- https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/structures/Guild.js#L1322
- https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/client/voice/ClientVoiceManager.js#L34
Is there a plan to implement something to @discordjs/core for this? Because this seems overly complicated
Not that I know of, but this is something that seems sensible to do. You could create an issue about this on the issue tracker, if there isn't one already.
GitHub
Implement guild.voiceAdapterCreator from discord.js into APIGuild f...
Which application or package is this feature request for? core Feature Right now, the only implementation of guild.voiceAdapterCreator is in Discord.js: https://github.com/discordjs/discord.js/blob...
made an issue as I didn't see one mentioned
We'll probably not add it to the returned object from api.guilds.get(), but I feel like making it a utility method on the client wouldn't be a terrible idea
whatever works best for you guys, but thank you!
has this been added?
I don’t think so.