我正在尝试使用 ID 向特定频道发送消息,但它输出 Cannot read 属性 'send' of undefined

I am trying to send a message to a specific channel using ID, but it outputs Cannot read property 'send' of undefined

我有一条建议命令要发送到服务器中的特定频道。

if (!args) return message.channel.send("Please input a suggestion"); {
client.channels.get("563804889268879390").send({embed: {
color: 0x333333,
author: {
 name: "New suggestion!",
},
fields: [{
 name: "User",
 value: ${message.author.user}
},
{
 name: "Suggestion",
 value: args
},
]}})}    

我已将消息定义为 client.on("message", async message => {。 即使当我键入不带任何参数的命令时,它也不会响应错误消息。当我尝试使用它时,它输出的所有内容都是 (node:17876) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined。这些参数在我的其他命令上工作正常,所以我不知道问题出在哪里。

Cannot read property 'send' of undefined 很可能意味着 client.channels.get("563804889268879390") 未定义,意味着频道 ID 错误或机器人不在频道所在的公会中。

请确保ID有效!