Discordjs messagecollector选择一个特定的频道

时间:2020-10-25 17:30:13

标签: javascript node.js discord

我想为特定通道创建一个消息收集器以记录所有消息,问题是我获得了通道ID,并创建了一个收集器,但是它抛出了该函数不存在的错误。

client.once("ready", () => {
    console.log(`Logged in as ${client.user.tag}!`);
    btcValue().then((value) => {
        client.user.setActivity(`BTC: ${value}`);
    });

    const filter = (m) => m.content.includes("discord");
    const channelGeneral = client.channels.fetch("CHANNEL_ID");
    console.log(channelgeneral);
    const collector = channelGeneral.createMessageCollector(filter);

    collector.on("collect", (m) => {
        console.log(`Cocollector: ${m.content}`);
    });
});

0 个答案:

没有答案