Fix sending previews without images
This commit is contained in:
parent
c3bdf3d411
commit
668a4a5402
1 changed files with 4 additions and 2 deletions
|
@ -78,7 +78,7 @@ export type CallbackResultType = {
|
||||||
type PreviewType = {
|
type PreviewType = {
|
||||||
url: string;
|
url: string;
|
||||||
title: string;
|
title: string;
|
||||||
image: AttachmentType;
|
image?: AttachmentType;
|
||||||
};
|
};
|
||||||
|
|
||||||
type QuoteAttachmentType = {
|
type QuoteAttachmentType = {
|
||||||
|
@ -573,7 +573,9 @@ export default class MessageSender {
|
||||||
const preview = await Promise.all(
|
const preview = await Promise.all(
|
||||||
(message.preview || []).map(async (item: PreviewType) => ({
|
(message.preview || []).map(async (item: PreviewType) => ({
|
||||||
...item,
|
...item,
|
||||||
image: await this.makeAttachmentPointer(item.image),
|
image: item.image
|
||||||
|
? await this.makeAttachmentPointer(item.image)
|
||||||
|
: undefined,
|
||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue