mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-23 09:35:02 +00:00
Same as before but smart :)
This commit is contained in:
parent
ac219dccbc
commit
f6456cd3d6
1 changed files with 2 additions and 6 deletions
|
@ -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,12 +39,7 @@ export async function postMessage(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let createdMsg;
|
const createdMsg = await channel.send(content);
|
||||||
if (file) {
|
|
||||||
createdMsg = await channel.send({ ...content, files: [file.file] });
|
|
||||||
} else {
|
|
||||||
createdMsg = await channel.send(content);
|
|
||||||
}
|
|
||||||
pluginData.state.savedMessages.setPermanent(createdMsg.id);
|
pluginData.state.savedMessages.setPermanent(createdMsg.id);
|
||||||
|
|
||||||
if (downloadedAttachment) {
|
if (downloadedAttachment) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue