mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: rename attachment_id to id
This commit is contained in:
@@ -149,14 +149,14 @@ export const webEvents: [string, Web.IncomingMessage, any][] = [
|
||||
attachments: {
|
||||
type: FileType.image,
|
||||
payload: {
|
||||
attachment_id: '9'.repeat(24),
|
||||
id: '9'.repeat(24),
|
||||
},
|
||||
},
|
||||
},
|
||||
message: {
|
||||
attachment: {
|
||||
payload: {
|
||||
attachment_id: '9'.repeat(24),
|
||||
id: '9'.repeat(24),
|
||||
},
|
||||
type: FileType.image,
|
||||
},
|
||||
|
||||
@@ -155,9 +155,7 @@ export default abstract class BaseWebChannelHandler<
|
||||
type: Web.IncomingMessageType.file,
|
||||
data: {
|
||||
type: attachmentPayload.type,
|
||||
url: await this.getPublicUrl(
|
||||
attachmentPayload.payload.attachment_id,
|
||||
),
|
||||
url: await this.getPublicUrl(attachmentPayload.payload.id),
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -992,7 +990,7 @@ export default abstract class BaseWebChannelHandler<
|
||||
type: Web.OutgoingMessageType.file,
|
||||
data: {
|
||||
type: message.attachment.type,
|
||||
url: await this.getPublicUrl(message.attachment.payload.attachment_id),
|
||||
url: await this.getPublicUrl(message.attachment.payload.id),
|
||||
},
|
||||
};
|
||||
if (message.quickReplies && message.quickReplies.length > 0) {
|
||||
@@ -1034,10 +1032,8 @@ export default abstract class BaseWebChannelHandler<
|
||||
if (fields.image_url && item[fields.image_url]) {
|
||||
const attachmentPayload = item[fields.image_url]
|
||||
.payload as AttachmentForeignKey;
|
||||
if (attachmentPayload.attachment_id) {
|
||||
element.image_url = await this.getPublicUrl(
|
||||
attachmentPayload.attachment_id,
|
||||
);
|
||||
if (attachmentPayload.id) {
|
||||
element.image_url = await this.getPublicUrl(attachmentPayload.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ export default class WebEventWrapper<N extends ChannelName> extends EventWrapper
|
||||
attachments: {
|
||||
type: Attachment.getTypeByMime(this._adapter.raw.data.type),
|
||||
payload: {
|
||||
attachment_id: this._adapter.attachment.id,
|
||||
id: this._adapter.attachment.id,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -278,7 +278,7 @@ export default class WebEventWrapper<N extends ChannelName> extends EventWrapper
|
||||
attachment: {
|
||||
type: fileType,
|
||||
payload: {
|
||||
attachment_id: this._adapter.attachment.id,
|
||||
id: this._adapter.attachment.id,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user