2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-29 05:17:41 +00:00

pr: Merge edited PR (#440)

This commit is contained in:
GochoMugo 2017-11-27 06:49:47 +03:00
commit 0008a39227
3 changed files with 56 additions and 0 deletions

View File

@ -9,6 +9,7 @@ Added:
1. Add Bot API v3.4 methods: 1. Add Bot API v3.4 methods:
* (#439) *TelegramBot#editMessageLiveLocation*, *TelegramBot#stopMessageLiveLocation* (by @kamikazechaser) * (#439) *TelegramBot#editMessageLiveLocation*, *TelegramBot#stopMessageLiveLocation* (by @kamikazechaser)
* (#440) *TelegramBot#setChatStickerSet*, *TelegramBot#deleteChatStickerSet* (by @kamikazechaser)
1. Add `metadata` argument in `message` event (and 1. Add `metadata` argument in `message` event (and
friends e.g. `text`, `audio`, etc.) (#409) (by @jlsjonas, @GochoMugo) friends e.g. `text`, `audio`, etc.) (#409) (by @jlsjonas, @GochoMugo)
1. Add support for Node.js v9 (by @GochoMugo) 1. Add support for Node.js v9 (by @GochoMugo)

View File

@ -71,6 +71,8 @@ TelegramBot
* [.getChatMembersCount(chatId)](#TelegramBot+getChatMembersCount) ⇒ <code>Promise</code> * [.getChatMembersCount(chatId)](#TelegramBot+getChatMembersCount) ⇒ <code>Promise</code>
* [.getChatMember(chatId, userId)](#TelegramBot+getChatMember) ⇒ <code>Promise</code> * [.getChatMember(chatId, userId)](#TelegramBot+getChatMember) ⇒ <code>Promise</code>
* [.leaveChat(chatId)](#TelegramBot+leaveChat) ⇒ <code>Promise</code> * [.leaveChat(chatId)](#TelegramBot+leaveChat) ⇒ <code>Promise</code>
* [.setChatStickerSet(chatId, stickerSetName)](#TelegramBot+setChatStickerSet) ⇒ <code>Promise</code>
* [.deleteChatStickerSet(chatId)](#TelegramBot+deleteChatStickerSet) ⇒ <code>Promise</code>
* [.sendGame(chatId, gameShortName, [options])](#TelegramBot+sendGame) ⇒ <code>Promise</code> * [.sendGame(chatId, gameShortName, [options])](#TelegramBot+sendGame) ⇒ <code>Promise</code>
* [.setGameScore(userId, score, [options])](#TelegramBot+setGameScore) ⇒ <code>Promise</code> * [.setGameScore(userId, score, [options])](#TelegramBot+setGameScore) ⇒ <code>Promise</code>
* [.getGameHighScores(userId, [options])](#TelegramBot+getGameHighScores) ⇒ <code>Promise</code> * [.getGameHighScores(userId, [options])](#TelegramBot+getGameHighScores) ⇒ <code>Promise</code>
@ -935,6 +937,31 @@ Leave a group, supergroup or channel.
| --- | --- | --- | | --- | --- | --- |
| chatId | <code>Number</code> &#124; <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) | | chatId | <code>Number</code> &#124; <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
<a name="TelegramBot+setChatStickerSet"></a>
### telegramBot.setChatStickerSet(chatId, stickerSetName) ⇒ <code>Promise</code>
Use this method to set a new group sticker set for a supergroup.
**Kind**: instance method of <code>[TelegramBot](#TelegramBot)</code>
**See**: https://core.telegram.org/bots/api#setchatstickerset
| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> &#124; <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| stickerSetName | <code>String</code> | Name of the sticker set to be set as the group sticker set |
<a name="TelegramBot+deleteChatStickerSet"></a>
### telegramBot.deleteChatStickerSet(chatId) ⇒ <code>Promise</code>
Use this method to delete a group sticker set from a supergroup.
**Kind**: instance method of <code>[TelegramBot](#TelegramBot)</code>
**See**: https://core.telegram.org/bots/api#deletechatstickerset
| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> &#124; <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
<a name="TelegramBot+sendGame"></a> <a name="TelegramBot+sendGame"></a>
### telegramBot.sendGame(chatId, gameShortName, [options]) ⇒ <code>Promise</code> ### telegramBot.sendGame(chatId, gameShortName, [options]) ⇒ <code>Promise</code>

View File

@ -1448,6 +1448,34 @@ class TelegramBot extends EventEmitter {
return this._request('leaveChat', { form }); return this._request('leaveChat', { form });
} }
/**
* Use this method to set a new group sticker set for a supergroup.
* @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
* @param {String} stickerSetName Name of the sticker set to be set as the group sticker set
* @return {Promise}
* @see https://core.telegram.org/bots/api#setchatstickerset
*/
setChatStickerSet(chatId, stickerSetName) {
const form = {
chat_id: chatId,
sticker_set_name: stickerSetName
};
return this._request('setChatStickerSet', { form });
}
/**
* Use this method to delete a group sticker set from a supergroup.
* @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
* @return {Promise}
* @see https://core.telegram.org/bots/api#deletechatstickerset
*/
deleteChatStickerSet(chatId) {
const form = {
chat_id: chatId
};
return this._request('deleteChatStickerSet', { form });
}
/** /**
* Use this method to send a game. * Use this method to send a game.
* @param {Number|String} chatId Unique identifier for the message recipient * @param {Number|String} chatId Unique identifier for the message recipient