Typescript complains about adapterCreator after upgrading to v0.17.0

i updated @discordjs/voice from 0.16.1 to 0.17.0 and discord.js from 14.14.1 to 14.16.3, and now this snippet makes typescript complains about
Type 'InternalDiscordGatewayAdapterCreator' is not assignable to type 'DiscordGatewayAdapterCreator'.
Types of parameters 'methods' and 'methods' are incompatible.
...
Type 'InternalDiscordGatewayAdapterCreator' is not assignable to type 'DiscordGatewayAdapterCreator'.
Types of parameters 'methods' and 'methods' are incompatible.
...
// for demonstration purposes only
import { joinVoiceChannel } from "@discordjs/voice"
import { Client, GatewayIntentBits } from "discord.js"

const client = new Client({
intents: [
GatewayIntentBits.MessageContent,
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessageReactions,
],
})
await client.login("asdf")

const guild = await client.guilds.fetch("1234")
joinVoiceChannel({
guildId: guild.id,
channelId: "5678",
adapterCreator: guild.voiceAdapterCreator,
})
// for demonstration purposes only
import { joinVoiceChannel } from "@discordjs/voice"
import { Client, GatewayIntentBits } from "discord.js"

const client = new Client({
intents: [
GatewayIntentBits.MessageContent,
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessageReactions,
],
})
await client.login("asdf")

const guild = await client.guilds.fetch("1234")
joinVoiceChannel({
guildId: guild.id,
channelId: "5678",
adapterCreator: guild.voiceAdapterCreator,
})
how do i fix this? are there changes i missed? the changelogs for voice 0.17.0 doesn't seem to mention anything about voice adapter creators
2 Replies
d.js toolkit
d.js toolkit2mo ago
- What are your intents? GuildVoiceStates is required to receive voice data! - Show what dependencies you are using -- generateDependencyReport() is exported from @discordjs/voice. - Try looking at common examples: https://github.com/discordjs/voice-examples. - 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! - Marked as resolved by OP
Nutchapol
NutchapolOP2mo ago
how is that possible i thought there's always only 1 version of a dependency installed? -# feels like rust all of a sudden or is it typescript doing its own thing? oh right, dependencies in node_modules can have node_modules of their own

Did you find this page helpful?