132
rated 0 times
[
138]
[
6]
/ answers: 1 / hits: 8566
/ 3 Years ago, sun, august 15, 2021, 12:00:00
After upgrading to discord.js v13 and using Array.from(message.attachments.values())
instead of message.attachments.array()
to send attachments from a message,
message.client.channels.cache.get("123456789").send({
files: [Array.from(message.attachments.values())],
content: `test`
});
I get an error from the console from the node module:
DesktopBotnode_modulesdiscord.jssrcstructuresMessagePayload.js:223
if (thing.path) {
^
TypeError: Cannot read property 'path' of undefined
The part where the error comes is here:
const findName = thing => {
if (typeof thing === 'string') {
return Util.basename(thing);
}
if (thing.path) {
return Util.basename(thing.path);
}
return 'file.jpg';
};
I'm really confused on what's wrong or how to fix it, any help?
More From » discord.js