【发布时间】:2021-10-17 18:38:47
【问题描述】:
升级到 discord.js v13 并使用 Array.from(message.attachments.values()) 代替 message.attachments.array() 从邮件中发送附件后,
message.client.channels.cache.get("123456789").send({
files: [Array.from(message.attachments.values())],
content: `test`
});
我从节点模块的控制台收到错误:
Desktop\Bot\node_modules\discord.js\src\structures\MessagePayload.js:223
if (thing.path) {
^
TypeError: Cannot read property 'path' of undefined
错误出现的部分在这里:
const findName = thing => {
if (typeof thing === 'string') {
return Util.basename(thing);
}
if (thing.path) {
return Util.basename(thing.path);
}
return 'file.jpg';
};
我真的很困惑出了什么问题或如何解决它,有什么帮助吗?
【问题讨论】:
标签: javascript discord.js