Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js DiscordAPIError:解析ID时通道未知_Node.js_Discord_Discord.js - Fatal编程技术网

Node.js DiscordAPIError:解析ID时通道未知

Node.js DiscordAPIError:解析ID时通道未知,node.js,discord,discord.js,Node.js,Discord,Discord.js,我正在尝试从已保存的ID获取TextChannel对象-调试表明该ID是从数据库中提取的,并且格式正确,但在尝试运行函数时收到以下错误: DiscordAPIError: Unknown Channel at RequestHandler.execute (/home/user/Project/node_modules/discord.js/src/rest/RequestHandler.js:170:25) at processTicksAndRejections (internal/proc

我正在尝试从已保存的ID获取TextChannel对象-调试表明该ID是从数据库中提取的,并且格式正确,但在尝试运行函数时收到以下错误:

DiscordAPIError: Unknown Channel
at RequestHandler.execute (/home/user/Project/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
method: 'get',
path: '/channels/674680371077578800',
code: 10003,
httpStatus: 404
}
代码如下:

const servdata = await Servers.findOne({ where: { servID: message.guild.id}}) //Grabs Servdata for checks
    if (servdata) { //Checks if server has data
        if (servdata.settingUp) { //Handling Welcome Data Entry
            var expectedChannel = await client.channels.fetch(servdata.welcMessChannelID) //Gets the channel our setup message is in
            console.log(expectedChannel)