【发布时间】:2021-11-16 18:48:42
【问题描述】:
我在下面的代码中收到此错误:
(node:13760) UnhandledPromiseRejectionWarning: TypeError: 无法读取 未定义的属性“发送”
bot.on('message', async (message) => {
message
.delete({ timeout: 10 })
.catch((err) =>
logger.error(`Could not delete message (Error: ${err.message})`),
);
// Checking if command was executed in report channel
if (message.channel.name != 'from-user') {
// Do nothing
logger.info(
`message has not been sent in the forwarding channel! Aborting request.`,
);
} else {
if (message.author.bot) return;
await client.channels.cache.get('910109122572218378').send(message.content);
console.log(message.content); // log messages
return;
}
});
【问题讨论】:
标签: javascript discord discord.js