Discord V13 VoiceStateUpdate 不起作用

Discord V13 VoiceStateUpdate doesn't work

我正在为最新版本重写我的机器人。

我不明白为什么这不起作用。

bot.on('voiceStateUpdate', (oldMember, newMember) => {
    let userchID = newMember.channelID;
    let oldUserChannel = oldMember.channelID;
    let chat = bot.channels.cache.get(settings.channel.chatstreamer);

    if (userchID === settings.channel.stream){
        chat.permissionOverwrite.edit(newMember.id, {
            SEND_MESSAGES: true,
            VIEW_CHANNEL: true
        });
        return true;
    } else if (oldUserChannel === settings.channel.stream) {
        chat.permissionOverwrites.get(oldMember.id).delete();
        return true;
    }

对于 Discord V13,您的 newMember.channelIDoldMember.channelID 需要更改为 newMember.channelIdoldMember.channelId

只需要将D小写即可。