mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-23 01:25:02 +00:00
Fix Cannot read property 'pipe' of undefined
error if no file exists
This commit is contained in:
parent
11a82145b0
commit
ac219dccbc
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
pluginData.state.savedMessages.setPermanent(createdMsg.id);
|
||||||
|
|
||||||
if (downloadedAttachment) {
|
if (downloadedAttachment) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue