3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 16:55:03 +00:00

Fix Cannot read property 'pipe' of undefined error if no file exists

This commit is contained in:
Dark 2021-08-19 02:40:22 +02:00
parent 11a82145b0
commit ac219dccbc
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8

View file

@ -38,7 +38,12 @@ export async function postMessage(
};
}
const createdMsg = await channel.send({ ...content, files: [file] });
let createdMsg;
if (file) {
createdMsg = await channel.send({ ...content, files: [file.file] });
} else {
createdMsg = await channel.send(content);
}
pluginData.state.savedMessages.setPermanent(createdMsg.id);
if (downloadedAttachment) {