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

Same as before but smart :)

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

View file

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