mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-31 06:16:07 +00:00
src/telegram: Add TelegramBot#uploadStickerFile
Notes: * Closes PR #430 References: * FR: https://github.com/yagop/node-telegram-bot-api/issues/407 * PR: https://github.com/yagop/node-telegram-bot-api/pull/430 * PR-by: @CapacitorSet
This commit is contained in:
16
doc/api.md
16
doc/api.md
@@ -76,6 +76,7 @@ TelegramBot
|
||||
* [.answerShippingQuery(shippingQueryId, ok, [options])](#TelegramBot+answerShippingQuery) ⇒ <code>Promise</code>
|
||||
* [.answerPreCheckoutQuery(preCheckoutQueryId, ok, [options])](#TelegramBot+answerPreCheckoutQuery) ⇒ <code>Promise</code>
|
||||
* [.getStickerSet(name, [options])](#TelegramBot+getStickerSet) ⇒ <code>Promise</code>
|
||||
* [.uploadStickerFile(userId, pngSticker, [options])](#TelegramBot+uploadStickerFile) ⇒ <code>Promise</code>
|
||||
* _static_
|
||||
* [.Promise](#TelegramBot.Promise)
|
||||
|
||||
@@ -991,6 +992,21 @@ Use this method to get a sticker set. On success, a [StickerSet](https://core.te
|
||||
| name | <code>String</code> | Name of the sticker set |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+uploadStickerFile"></a>
|
||||
|
||||
### telegramBot.uploadStickerFile(userId, pngSticker, [options]) ⇒ <code>Promise</code>
|
||||
Use this method to upload a .png file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple
|
||||
times). Returns the uploaded [File](https://core.telegram.org/bots/api#file) on success.
|
||||
|
||||
**Kind**: instance method of <code>[TelegramBot](#TelegramBot)</code>
|
||||
**See**: https://core.telegram.org/bots/api#uploadstickerfile
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| userId | <code>Number</code> | User identifier of sticker file owner |
|
||||
| pngSticker | <code>String</code> | <code>stream.Stream</code> | <code>Buffer</code> | A file path or a Stream. Can also be a `file_id` previously uploaded. **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. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot.Promise"></a>
|
||||
|
||||
### TelegramBot.Promise
|
||||
|
Reference in New Issue
Block a user