diff --git a/backend/src/plugins/Post/util/postMessage.ts b/backend/src/plugins/Post/util/postMessage.ts index 9d4b67f4..f8b375b0 100644 --- a/backend/src/plugins/Post/util/postMessage.ts +++ b/backend/src/plugins/Post/util/postMessage.ts @@ -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) {