Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lib/facebook/format-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,24 @@ class Video extends FacebookTemplate {
}
}

class VideoFromAttachment extends FacebookTemplate {
constructor(attachment_id) {
super();

if (!attachment_id || '') {
throw new Error('The attachment requires a valid attachment id as the first parameter');
}
this.template = {
attachment: {
type: 'video',
payload: {
attachment_id: attachment_id
}
}
};
}
}

class File extends FacebookTemplate {
constructor(url) {
super();
Expand Down Expand Up @@ -1046,6 +1064,7 @@ module.exports = {
Image: Image,
Audio: Audio,
Video: Video,
VideoFromAttachment: VideoFromAttachment,
File: File,
Generic: Generic,
Button: Button,
Expand Down