/**
* Use this method to create new sticker set owned by a user.
*
* The bot will be able to edit the created sticker set.
*
* You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*
*
* @param {Number} userId User identifier of created sticker set owner
* @param {String} name Short name of sticker set, to be used in `t.me/addstickers/` URLs (e.g., *"animals"*). Can contain only english letters, digits and underscores.
* Must begin with a letter, can't contain consecutive underscores and must end in `"_by_<bot_username>"`. `<bot_username>` is case insensitive. 1-64 characters.
* @param {String} title Sticker set title, 1-64 characters
* @param {String|stream.Stream|Buffer} pngSticker Png image with the sticker, must be up to 512 kilobytes in size,
* dimensions must not exceed 512px, and either width or height must be exactly 512px.
* @param {String} emojis One or more emoji corresponding to the sticker
* @param {Object} [options] Additional Telegram query options
* @param {Object} [fileOptions] Optional file related meta-data
* @return {Promise} True on success
* @see https://core.telegram.org/bots/api#createnewstickerset
*/
createNewStickerSet(userId, name, title, pngSticker, emojis, options = {}, fileOptions = {}) {
const opts = {
qs: options,
};
opts.qs.user_id = userId;
opts.qs.name = name;
opts.qs.title = title;
opts.qs.emojis = emojis;
opts.qs.mask_position = stringify(options.mask_position);
try {
const sendData = this._formatSendData('png_sticker', pngSticker, fileOptions);
opts.formData = sendData[0];
opts.qs.png_sticker = sendData[1];
} catch (ex) {
return Promise.reject(ex);
}
return this._request('createNewStickerSet', opts);
}
Well, I have solved this problem. It doesn't happen on this function, but the other in my code.
However, I will keep this issue open for the confused API difference.
Expected Behavior
When I used
createNewStickerSet
I got an error.(The error message is at the buttom)This is the API right now:
But I found that in the newest telegram API it seems like we don't need to send the key
emoji
: https://core.telegram.org/bots/api#createnewstickersetThe cURL command can be like:
Maybe the api needs to be updated, or there is other way to get rid of this error.
Actual Behavior