首页 > 解决方案 > 错误无法读取 discord.js 中未定义的属性“缓存”

问题描述

我尝试将其更改client.channelsclient.channel client.channelId仍然没有运气,试图解决这个问题已经有一段时间了,请帮忙。我正在使用 discord.js v13.1.0 顺便说一句

const filter = (m) => m.author.id === message.author.id;
    const appStart = await message.author.send({ content: questions[collectCounter++] });
    const channel = appStart.channel;
    const collector = channel.createMessageCollector(filter);

    collector.on("collect", () => {
        if (collectCounter < questions.length){
            channel.send(quesstions[collectCounter++]);
        } else {
            channel.send("Your profile has been succesfully updated")
            Collector.stop("fulfilled"); 
        }
    });
    const femalechannel = client.channels.cache.get("881098900600152084"); 
    const malechannel = client.channels.cache.get("881098930711035924");

标签: cachingdiscord.js

解决方案


推荐阅读