@@ -2335,6 +2335,38 @@ class TelegramBot extends EventEmitter {
2335
2335
}
2336
2336
return this . _request ( 'addStickerToSet' , opts ) ;
2337
2337
}
2338
+
2339
+ /**
2340
+ * Use this method to add a thumb to a set created by the bot.
2341
+ * Returns True on success.
2342
+ *
2343
+ * @param {Number } userId User identifier of sticker set owner
2344
+ * @param {String } name Sticker set name
2345
+ * @param {String|stream.Stream|Buffer } pngThumb A PNG image with the thumbnail,
2346
+ * must be up to 128 kilobytes in size and have width and height exactly 100px,
2347
+ * or a TGS animation with the thumbnail up to 32 kilobytes in size;
2348
+ * @param {Object } [options] Additional Telegram query options
2349
+ * @param {Object } [fileOptions] Optional file related meta-data
2350
+ * @return {Promise }
2351
+ * @see https://core.telegram.org/bots/api#setstickersetthumb
2352
+ * @todo Add tests for this method!
2353
+ */
2354
+ setStickerSetThumb ( userId , name , pngThumb , options = { } , fileOptions = { } ) {
2355
+ const opts = {
2356
+ qs : options ,
2357
+ } ;
2358
+ opts . qs . user_id = userId ;
2359
+ opts . qs . name = name ;
2360
+ opts . qs . mask_position = stringify ( options . mask_position ) ;
2361
+ try {
2362
+ const sendData = this . _formatSendData ( 'thumb' , pngThumb , fileOptions ) ;
2363
+ opts . formData = sendData [ 0 ] ;
2364
+ opts . qs . thumb = sendData [ 1 ] ;
2365
+ } catch ( ex ) {
2366
+ return Promise . reject ( ex ) ;
2367
+ }
2368
+ return this . _request ( 'setStickerSetThumb' , opts ) ;
2369
+ }
2338
2370
2339
2371
/**
2340
2372
* Use this method to move a sticker in a set created by the bot to a specific position.
0 commit comments