diff --git a/doc/api.md b/doc/api.md index 21e5fa0..5718653 100644 --- a/doc/api.md +++ b/doc/api.md @@ -89,11 +89,16 @@ TelegramBot * [.deleteChatStickerSet(chatId, [options])](#TelegramBot+deleteChatStickerSet) ⇒ Promise * [.getForumTopicIconStickers(chatId, [options])](#TelegramBot+getForumTopicIconStickers) ⇒ Promise * [.createForumTopic(chatId, name, [options])](#TelegramBot+createForumTopic) - * [.editForumTopic(chatId, messageThreadId, name, iconCustomEmojiId, [options])](#TelegramBot+editForumTopic) ⇒ Promise + * [.editForumTopic(chatId, messageThreadId, [options])](#TelegramBot+editForumTopic) ⇒ Promise * [.closeForumTopic(chatId, messageThreadId, [options])](#TelegramBot+closeForumTopic) ⇒ Promise * [.reopenForumTopic(chatId, messageThreadId, [options])](#TelegramBot+reopenForumTopic) ⇒ Promise * [.deleteForumTopic(chatId, messageThreadId, [options])](#TelegramBot+deleteForumTopic) ⇒ Promise * [.unpinAllForumTopicMessages(chatId, messageThreadId, [options])](#TelegramBot+unpinAllForumTopicMessages) ⇒ Promise + * [.editGeneralForumTopic(chatId, name, [options])](#TelegramBot+editGeneralForumTopic) ⇒ Promise + * [.closeGeneralForumTopic(chatId, [options])](#TelegramBot+closeGeneralForumTopic) ⇒ Promise + * [.reopenGeneralForumTopic(chatId, [options])](#TelegramBot+reopenGeneralForumTopic) ⇒ Promise + * [.hideGeneralForumTopic(chatId, [options])](#TelegramBot+hideGeneralForumTopic) ⇒ Promise + * [.unhideGeneralForumTopic(chatId, [options])](#TelegramBot+unhideGeneralForumTopic) ⇒ Promise * [.answerCallbackQuery(callbackQueryId, [options])](#TelegramBot+answerCallbackQuery) ⇒ Promise * [.setMyCommands(commands, [options])](#TelegramBot+setMyCommands) ⇒ Promise * [.deleteMyCommands([options])](#TelegramBot+deleteMyCommands) ⇒ Promise @@ -1405,7 +1410,7 @@ Returns information about the created topic as a [ForumTopic](https://core.teleg -### telegramBot.editForumTopic(chatId, messageThreadId, name, iconCustomEmojiId, [options]) ⇒ Promise +### telegramBot.editForumTopic(chatId, messageThreadId, [options]) ⇒ Promise Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic. @@ -1417,8 +1422,6 @@ The bot must be an administrator in the chat for this to work and must have can_ | --- | --- | --- | | chatId | Number \| String | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) | | messageThreadId | Number | Unique identifier for the target message thread of the forum topic | -| name | String | New topic name, 1-128 characters | -| iconCustomEmojiId | String | New unique identifier of the custom emoji shown as the topic icon. Use [getForumTopicIconStickers](https://core.telegram.org/bots/api#getforumtopiciconstickers) to get all allowed custom emoji identifiers | | [options] | Object | Additional Telegram query options | @@ -1485,6 +1488,86 @@ The bot must be an administrator in the chat for this to work and must have the | messageThreadId | Number | Unique identifier for the target message thread of the forum topic | | [options] | Object | Additional Telegram query options | + + +### telegramBot.editGeneralForumTopic(chatId, name, [options]) ⇒ Promise +Use this method to edit the name of the 'General' topic in a forum supergroup chat. +The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. +The topic will be automatically unhidden if it was hidden. + +**Kind**: instance method of [TelegramBot](#TelegramBot) +**Returns**: Promise - True on success +**See**: https://core.telegram.org/bots/api#editgeneralforumtopic + +| Param | Type | Description | +| --- | --- | --- | +| chatId | Number \| String | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) | +| name | String | New topic name, 1-128 characters | +| [options] | Object | Additional Telegram query options | + + + +### telegramBot.closeGeneralForumTopic(chatId, [options]) ⇒ Promise +Use this method to close an open 'General' topic in a forum supergroup chat. +The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. +The topic will be automatically unhidden if it was hidden. + +**Kind**: instance method of [TelegramBot](#TelegramBot) +**Returns**: Promise - True on success +**See**: https://core.telegram.org/bots/api#closegeneralforumtopic + +| Param | Type | Description | +| --- | --- | --- | +| chatId | Number \| String | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) | +| [options] | Object | Additional Telegram query options | + + + +### telegramBot.reopenGeneralForumTopic(chatId, [options]) ⇒ Promise +Use this method to reopen a closed 'General' topic in a forum supergroup chat. +The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. +The topic will be automatically unhidden if it was hidden. + +**Kind**: instance method of [TelegramBot](#TelegramBot) +**Returns**: Promise - True on success +**See**: https://core.telegram.org/bots/api#reopengeneralforumtopic + +| Param | Type | Description | +| --- | --- | --- | +| chatId | Number \| String | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) | +| [options] | Object | Additional Telegram query options | + + + +### telegramBot.hideGeneralForumTopic(chatId, [options]) ⇒ Promise +Use this method to hide the 'General' topic in a forum supergroup chat. +The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. +The topic will be automatically closed if it was open. + +**Kind**: instance method of [TelegramBot](#TelegramBot) +**Returns**: Promise - True on success +**See**: https://core.telegram.org/bots/api#hidegeneralforumtopic + +| Param | Type | Description | +| --- | --- | --- | +| chatId | Number \| String | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) | +| [options] | Object | Additional Telegram query options | + + + +### telegramBot.unhideGeneralForumTopic(chatId, [options]) ⇒ Promise +Use this method to unhide the 'General' topic in a forum supergroup chat. +The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights + +**Kind**: instance method of [TelegramBot](#TelegramBot) +**Returns**: Promise - True on success +**See**: https://core.telegram.org/bots/api#unhidegeneralforumtopic + +| Param | Type | Description | +| --- | --- | --- | +| chatId | Number \| String | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) | +| [options] | Object | Additional Telegram query options | + ### telegramBot.answerCallbackQuery(callbackQueryId, [options]) ⇒ Promise