Discord.js 删除频道

时间:2021-05-09 14:38:27

标签: javascript node.js discord discord.js

我正在使用discord.js创建一个discord bot,每次删除指定频道时我都需要做一个控制,你知道怎么做吗?我在指南上搜索,但没有找到任何东西

1 个答案:

答案 0 :(得分:1)

您确定检查了 Docs 吗?
再试试看。
举个例子:

Client.on("channelDelete", channel=> {
    console.log(`${channel.name} Was deleted`);
})

针对特定频道

Client.on("channelDelete", channel=> {
    if(channel.id === "TheSpeceficChannelID"){
        console.log(`The channel ${channel.name} Was deleted`);
    }
})