@@ -79,7 +79,7 @@ class Image extends Media {
79
79
* Create a Image object for the API
80
80
*
81
81
* @param {String } image The image file's link or id
82
- * @param {Boolean } isItAnID Whether document is an id (true) or a link (false)
82
+ * @param {Boolean } isItAnID Whether image is an id (true) or a link (false)
83
83
* @param {String } [caption] Describes the specified image media
84
84
*/
85
85
constructor ( image , isItAnID = false , caption ) {
@@ -99,27 +99,32 @@ class Sticker extends Media {
99
99
* Create a Sticker object for the API
100
100
*
101
101
* @param {String } sticker The sticker file's link
102
+ * @param {Boolean } isItAnID Whether sticker is an id (true) or a link (false)
102
103
*/
103
- constructor ( sticker ) {
104
- if ( ! sticker ) throw new Error ( "Sticker must have a sticker link" ) ;
105
- super ( "sticker" , sticker ) ;
104
+ constructor ( sticker , isItAnID = false ) {
105
+ if ( ! sticker ) throw new Error ( "Sticker must have a sticker link or id " ) ;
106
+ super ( "sticker" , sticker , isItAnID ) ;
106
107
}
107
108
}
108
109
109
110
/**
110
111
* Video API component
111
112
*
112
113
* @extends Media
114
+ * @property {String } [caption] The file's caption
113
115
*/
114
116
class Video extends Media {
115
117
/**
116
118
* Create a Video object for the API
117
119
*
118
120
* @param {String } video The video file's link
121
+ * @param {Boolean } isItAnID Whether video is an id (true) or a link (false)
122
+ * @param {String } [caption] Describes the specified image media
119
123
*/
120
- constructor ( video ) {
121
- if ( ! video ) throw new Error ( "Video must have a video link" ) ;
122
- super ( "video" , video ) ;
124
+ constructor ( video , isItAnID = false , caption ) {
125
+ if ( ! video ) throw new Error ( "Video must have a video link or id" ) ;
126
+ super ( "video" , video , isItAnID ) ;
127
+ if ( caption ) this . caption = caption ;
123
128
}
124
129
}
125
130
0 commit comments