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

Typescript: Type 'InternalDiscordGatewayAdapterCreator' is not assignable to type 'DiscordGatewayAdapterCreator'. #10560

Open
Alexejhero opened this issue Oct 16, 2024 · 1 comment

Comments

@Alexejhero
Copy link

Alexejhero commented Oct 16, 2024

Which package is this bug report for?

voice

Issue description

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("/ node_modules/ discord-api-types/ payloads/ v10/ guild").APIGuildMember | undefined' is not assignable to type 'import("/ node_modules/@discordjs/ ws/ node_modules/ discord-api-types/ payloads/ v10/ guild").APIGuildMember | undefined'.
Type 'import("/ node_modules/ discord-api-types/ payloads/ v10/ guild").APIGuildMember' is not assignable to type 'import("/ node_modules/@discordjs/ ws/ node_modules/ discord-api-types/ payloads/ v10/ guild").APIGuildMember'.
Types of property flags are incompatible.
Type 'import("/ node_modules/ discord-api-types/ payloads/ v10/ guild").GuildMemberFlags' is not assignable to type 'import("/ node_modules/@discordjs/ ws/ node_modules/ discord-api-types/ payloads/ v10/ guild").GuildMemberFlags'.
Property IsGuest is missing in type
import("/ node_modules/@discordjs/ ws/ node_modules/ discord-api-types/ payloads/ v10/ guild").GuildMemberFlags

Code sample

client.on("ready", async () => {
    const guild = await client.guilds.fetch("...")
    const channel = await guild.channels.fetch("...");

    if (channel == null) {
        console.error("Channel not found");
        return;
    }

    if (channel.type != ChannelType.GuildVoice && channel.type != ChannelType.GuildStageVoice) {
        console.error("Channel is not a voice channel");
        return;
    }

    joinVoiceChannel({
        channelId: channel.id,
        guildId: guild.id,
        adapterCreator: guild.voiceAdapterCreator // ERROR
    })
})

Versions

Issue priority

Low (slightly annoying)

Which partials do you have configured?

No Partials

Which gateway intents are you subscribing to?

GuildVoiceStates

I have tested this issue on a development release

No response

@Alexejhero Alexejhero changed the title Typescript: Type 'InternalDiscordGatewayAdapterCreator' is not assignable to type 'DiscordGatewayAdapterCreator'.Typescript: Type 'InternalDiscordGatewayAdapterCreator' is not assignable to type 'DiscordGatewayAdapterCreator'. Typescript: Type 'InternalDiscordGatewayAdapterCreator' is not assignable to type 'DiscordGatewayAdapterCreator'. Oct 16, 2024
@ArminDevelops
Copy link

Can reproduce this on our end as well. We're working around it by doing this for now, but hoping for a proper fix soon.

adapterCreator: createdChannel.guild.voiceAdapterCreator as DiscordGatewayAdapterCreator

Running on discordjs 14.16.3 and @discordjs/voice 0.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants