3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-18 15:00:00 +00:00

Post: fix cannot read pipe error when no file is present on message (#249)

This commit is contained in:
Nils 2021-08-19 17:25:19 +02:00 committed by GitHub
parent 11a82145b0
commit 1e75b81a5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,6 +30,7 @@ export async function postMessage(
name: attachments[0].name, name: attachments[0].name,
file: await fsp.readFile(downloadedAttachment.path), file: await fsp.readFile(downloadedAttachment.path),
}; };
content.files = [file.file];
} }
if (enableMentions) { if (enableMentions) {
@ -38,7 +39,7 @@ export async function postMessage(
}; };
} }
const createdMsg = await channel.send({ ...content, files: [file] }); const createdMsg = await channel.send(content);
pluginData.state.savedMessages.setPermanent(createdMsg.id); pluginData.state.savedMessages.setPermanent(createdMsg.id);
if (downloadedAttachment) { if (downloadedAttachment) {