Type 'InternalDiscordGatewayAdapterCreator' is not assignable to type 'DiscordGatewayAdapterCreator'

// package.json
"dependencies": {
"@discordjs/voice": "^0.17.0",
"@prisma/client": "^5.20.0",
"discord.js": "^14.16.3",
"dotenv": "^16.4.5",
"libsodium-wrappers": "^0.7.15",
"markov-strings": "^3.0.1",
"moment": "^2.30.1",
"mongodb": "^6.9.0"
},
"devDependencies": {
"nodemon": "^3.1.7",
"prettier": "^3.3.3",
"prisma": "^5.20.0",
"typescript": "^5.6.2"
}
// package.json
"dependencies": {
"@discordjs/voice": "^0.17.0",
"@prisma/client": "^5.20.0",
"discord.js": "^14.16.3",
"dotenv": "^16.4.5",
"libsodium-wrappers": "^0.7.15",
"markov-strings": "^3.0.1",
"moment": "^2.30.1",
"mongodb": "^6.9.0"
},
"devDependencies": {
"nodemon": "^3.1.7",
"prettier": "^3.3.3",
"prisma": "^5.20.0",
"typescript": "^5.6.2"
}
// join.ts
import {
GuildMember,
InteractionContextType,
SlashCommandBuilder,
} from 'discord.js';
import { joinVoiceChannel } from '@discordjs/voice';
import Command from '../interfaces/command';
import emojiMap from '../utils/emojiMap';

const join: Command = {
data: new SlashCommandBuilder()
.setName('join')
.setDescription('Join the voice channel.')
.setContexts(InteractionContextType.Guild),
usage: '/join',
execute: async interaction => {
if (!interaction.guild || !interaction.member) return;
const guildMember = interaction.member as GuildMember;
const voiceChannel = guildMember.voice.channel;

if (!voiceChannel) {
await interaction.reply(
`${emojiMap.error.cross} You are not in a voice channel.`,
);
return;
}

joinVoiceChannel({
channelId: voiceChannel.id,
guildId: interaction.guild.id,
selfDeaf: false,
selfMute: false,
adapterCreator: interaction.guild.voiceAdapterCreator,
});

await interaction.reply(
`${emojiMap.sound.normal} Joined the voice channel ${voiceChannel.name}`,
);
},
};

export default join;
// join.ts
import {
GuildMember,
InteractionContextType,
SlashCommandBuilder,
} from 'discord.js';
import { joinVoiceChannel } from '@discordjs/voice';
import Command from '../interfaces/command';
import emojiMap from '../utils/emojiMap';

const join: Command = {
data: new SlashCommandBuilder()
.setName('join')
.setDescription('Join the voice channel.')
.setContexts(InteractionContextType.Guild),
usage: '/join',
execute: async interaction => {
if (!interaction.guild || !interaction.member) return;
const guildMember = interaction.member as GuildMember;
const voiceChannel = guildMember.voice.channel;

if (!voiceChannel) {
await interaction.reply(
`${emojiMap.error.cross} You are not in a voice channel.`,
);
return;
}

joinVoiceChannel({
channelId: voiceChannel.id,
guildId: interaction.guild.id,
selfDeaf: false,
selfMute: false,
adapterCreator: interaction.guild.voiceAdapterCreator,
});

await interaction.reply(
`${emojiMap.sound.normal} Joined the voice channel ${voiceChannel.name}`,
);
},
};

export default join;
I'm getting an error that the InternalDiscordGatewayAdapterCreator is not assignable to the type DiscordGatewayAdapterCreator. I'm using discord.js v14.16.3 and @discordjs/voice v0.17.0 as shown in my package.json. The code still compiles and my bot can still join voice channels, its just giving me this error everytime I run tsc.
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
Omr
OmrOP2mo ago
Type 'InternalDiscordGatewayAdapterCreator' is not assignable to type 'DiscordGatewayAdapterCreator'.
Types of parameters 'methods' and 'methods' are incompatible.
Type 'DiscordGatewayAdapterLibraryMethods' is not assignable to type 'InternalDiscordGatewayAdapterLibraryMethods'.
Types of property 'onVoiceStateUpdate' are incompatible.
Type '(data: GatewayVoiceState) => void' is not assignable to type '(data: APIVoiceState) => void'.
Types of parameters 'data' and 'data' are incompatible.
Type 'APIVoiceState' is not assignable to type 'GatewayVoiceState'.
Types of property 'member' are incompatible.
Type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").APIGuildMember | undefined' is not assignable to type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").APIGuildMember | undefined'.
Type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").APIGuildMember' is not assignable to type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").APIGuildMember'.
Types of property 'flags' are incompatible.
Type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").GuildMemberFlags' is not assignable to type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").GuildMemberFlags'.
Property 'IsGuest' is missing in type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").GuildMemberFlags'.ts(2322)
index.d.ts(1545, 5): The expected type comes from property 'adapterCreator' which is declared here on type 'CreateVoiceConnectionOptions & JoinVoiceChannelOptions'
Type 'InternalDiscordGatewayAdapterCreator' is not assignable to type 'DiscordGatewayAdapterCreator'.
Types of parameters 'methods' and 'methods' are incompatible.
Type 'DiscordGatewayAdapterLibraryMethods' is not assignable to type 'InternalDiscordGatewayAdapterLibraryMethods'.
Types of property 'onVoiceStateUpdate' are incompatible.
Type '(data: GatewayVoiceState) => void' is not assignable to type '(data: APIVoiceState) => void'.
Types of parameters 'data' and 'data' are incompatible.
Type 'APIVoiceState' is not assignable to type 'GatewayVoiceState'.
Types of property 'member' are incompatible.
Type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").APIGuildMember | undefined' is not assignable to type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").APIGuildMember | undefined'.
Type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").APIGuildMember' is not assignable to type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").APIGuildMember'.
Types of property 'flags' are incompatible.
Type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").GuildMemberFlags' is not assignable to type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").GuildMemberFlags'.
Property 'IsGuest' is missing in type 'import("/home/name/Dev/bot/node_modules/.pnpm/[email protected]/node_modules/discord-api-types/payloads/v10/guild").GuildMemberFlags'.ts(2322)
index.d.ts(1545, 5): The expected type comes from property 'adapterCreator' which is declared here on type 'CreateVoiceConnectionOptions & JoinVoiceChannelOptions'
I've tried to delete my node_modules and pnpm lockfile, reinstall typescript, discord.js, @discordjs/voice, etc. Restarting the TS server on vs code, reloading the window, even asking chatgpt. Can't seem to figure out why its giving me this error all of the sudden when its never happened before
"dependencies": {
"@discordjs/voice": "^0.17.0",
"@prisma/client": "^5.20.0",
"discord-api-types": "^0.37.101",
"discord.js": "^14.16.3",
"dotenv": "^16.4.5",
"libsodium-wrappers": "^0.7.15",
"markov-strings": "^3.0.1",
"moment": "^2.30.1",
"mongodb": "^6.9.0"
},
"devDependencies": {
"nodemon": "^3.1.7",
"prettier": "^3.3.3",
"prisma": "^5.20.0",
"typescript": "^5.6.2"
},
"resolutions": {
"discord-api-types": "0.37.100"
}
"dependencies": {
"@discordjs/voice": "^0.17.0",
"@prisma/client": "^5.20.0",
"discord-api-types": "^0.37.101",
"discord.js": "^14.16.3",
"dotenv": "^16.4.5",
"libsodium-wrappers": "^0.7.15",
"markov-strings": "^3.0.1",
"moment": "^2.30.1",
"mongodb": "^6.9.0"
},
"devDependencies": {
"nodemon": "^3.1.7",
"prettier": "^3.3.3",
"prisma": "^5.20.0",
"typescript": "^5.6.2"
},
"resolutions": {
"discord-api-types": "0.37.100"
}
downgraded from 0.37.101 to 0.37.100 and the issue was fixed thank you 💯
Want results from more Discord servers?
Add your server