Skip to content

Commit 595cdbd

Browse files
feat: Telegram Bot API 6.8 support (yagop#1113)
* feat: Telegram Bot API 6.8 support * chore: telegramWebHook file format
1 parent dfe24a4 commit 595cdbd

File tree

6 files changed

+39
-5
lines changed

6 files changed

+39
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## [0.63.0][0.61.0] - 2023-08-23
7+
1. Support Telegram Bot API v6.8 (@danielperez9430)
8+
* unpinAllGeneralForumTopicMessages
9+
610
## [0.62.0][0.62.0] - 2023-03-19
711

8-
1. Support Telegram Bot API v6.6 (@danielperez9430)
12+
1. Support Telegram Bot API v6.6 & v6.7 (@danielperez9430)
913
* setMyDescription
1014
* getMyDescription
1115
* setMyShortDescription

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Node.js module to interact with the official [Telegram Bot API](https://core.telegram.org/bots/api).
66

77

8-
[![Bot API](https://img.shields.io/badge/Bot%20API-v.6.3-00aced.svg?style=flat-square&logo=telegram)](https://core.telegram.org/bots/api)
8+
[![Bot API](https://img.shields.io/badge/Bot%20API-v.6.8-00aced.svg?style=flat-square&logo=telegram)](https://core.telegram.org/bots/api)
99
[![npm package](https://img.shields.io/npm/v/node-telegram-bot-api?logo=npm&style=flat-square)](https://www.npmjs.org/package/node-telegram-bot-api)
1010
[![Build Status](https://img.shields.io/travis/yagop/node-telegram-bot-api/master?style=flat-square&logo=travis)](https://travis-ci.org/yagop/node-telegram-bot-api)
1111
[![Coverage Status](https://img.shields.io/codecov/c/github/yagop/node-telegram-bot-api?style=flat-square&logo=codecov)](https://codecov.io/gh/yagop/node-telegram-bot-api)

doc/api.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ TelegramBot
9999
* [.reopenGeneralForumTopic(chatId, [options])](#TelegramBot+reopenGeneralForumTopic) ⇒ <code>Promise</code>
100100
* [.hideGeneralForumTopic(chatId, [options])](#TelegramBot+hideGeneralForumTopic) ⇒ <code>Promise</code>
101101
* [.unhideGeneralForumTopic(chatId, [options])](#TelegramBot+unhideGeneralForumTopic) ⇒ <code>Promise</code>
102+
* [.unpinAllGeneralForumTopicMessages(chatId, [options])](#TelegramBot+unpinAllGeneralForumTopicMessages) ⇒ <code>Promise</code>
102103
* [.answerCallbackQuery(callbackQueryId, [options])](#TelegramBot+answerCallbackQuery) ⇒ <code>Promise</code>
103104
* [.setMyCommands(commands, [options])](#TelegramBot+setMyCommands) ⇒ <code>Promise</code>
104105
* [.deleteMyCommands([options])](#TelegramBot+deleteMyCommands) ⇒ <code>Promise</code>
@@ -440,7 +441,7 @@ that is being deprecated.
440441
| url | <code>String</code> | URL where Telegram will make HTTP Post. Leave empty to delete webHook. |
441442
| [options] | <code>Object</code> | Additional Telegram query options |
442443
| [options.certificate] | <code>String</code> \| <code>stream.Stream</code> | PEM certificate key (public). |
443-
| [options.secret_token] | <code>String</code> | A secret token to be sent in a header `X-Telegram-Bot-Api-Secret-Token` in every webhook request. |
444+
| [options.secret_token] | <code>String</code> | Optional secret token to be sent in a header `X-Telegram-Bot-Api-Secret-Token` in every webhook request. |
444445
| [fileOptions] | <code>Object</code> | Optional file related meta-data |
445446

446447
<a name="TelegramBot+deleteWebHook"></a>
@@ -1581,6 +1582,21 @@ The bot must be an administrator in the chat for this to work and must have the
15811582
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
15821583
| [options] | <code>Object</code> | Additional Telegram query options |
15831584

1585+
<a name="TelegramBot+unpinAllGeneralForumTopicMessages"></a>
1586+
1587+
### telegramBot.unpinAllGeneralForumTopicMessages(chatId, [options]) ⇒ <code>Promise</code>
1588+
Use this method to clear the list of pinned messages in a General forum topic.
1589+
The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.
1590+
1591+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1592+
**Returns**: <code>Promise</code> - True on success
1593+
**See**: https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
1594+
1595+
| Param | Type | Description |
1596+
| --- | --- | --- |
1597+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1598+
| [options] | <code>Object</code> | Additional Telegram query options |
1599+
15841600
<a name="TelegramBot+answerCallbackQuery"></a>
15851601

15861602
### telegramBot.answerCallbackQuery(callbackQueryId, [options]) ⇒ <code>Promise</code>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-telegram-bot-api",
3-
"version": "0.61.0",
3+
"version": "0.63.0",
44
"description": "Telegram Bot API",
55
"main": "./index.js",
66
"directories": {

src/telegram.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,6 +2069,20 @@ class TelegramBot extends EventEmitter {
20692069
return this._request('unhideGeneralForumTopic', { form });
20702070
}
20712071

2072+
/**
2073+
* Use this method to clear the list of pinned messages in a General forum topic.
2074+
* The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.
2075+
*
2076+
* @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
2077+
* @param {Object} [options] Additional Telegram query options
2078+
* @return {Promise} True on success
2079+
* @see https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
2080+
*/
2081+
unpinAllGeneralForumTopicMessages(chatId, form = {}) {
2082+
form.chat_id = chatId;
2083+
return this._request('unhideGeneralForumTopic', { form });
2084+
}
2085+
20722086
/**
20732087
* Use this method to send answers to callback queries sent from
20742088
* [inline keyboards](https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating).

src/telegramWebHook.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class TelegramBotWebHook {
4545
/**
4646
* Open WebHook by listening on the port
4747
* @return {Promise}
48-
*/
48+
*/
4949
open() {
5050
if (this.isOpen()) {
5151
return Promise.resolve();

0 commit comments

Comments
 (0)