Skip to content

Commit

Permalink
Unpin message by Id
Browse files Browse the repository at this point in the history
Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned. https://core.telegram.org/bots/api#unpinchatmessage
  • Loading branch information
fonclub authored and BoShurik committed Aug 9, 2023
1 parent 8b5c551 commit d66f4cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All Notable changes to `PHP Telegram Bot Api` will be documented in this file
- Fix phpDoc for `\TelegramBot\Api\Types\Message::$newChatMembers`
- Add `\TelegramBot\Api\BotApi::getChatMemberCount` method
- Add `\TelegramBot\Api\BotApi::banChatMember` method
- Add `$messageId` to `\TelegramBot\Api\BotApi::unpinChatMessage`

### Deprecated
- Deprecate using `thumb*` methods in `\TelegramBot\Api\BotApi`
Expand Down
6 changes: 4 additions & 2 deletions src/BotApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -2227,14 +2227,16 @@ public function pinChatMessage($chatId, $messageId, $disableNotification = false
*
* @param string|int $chatId Unique identifier for the target chat or username of the target channel
* (in the format @channelusername)
* @param int|null $messageId Identifier of a message to pin (optional)
*
* @return bool
* @throws Exception
*/
public function unpinChatMessage($chatId)
public function unpinChatMessage($chatId, $messageId = null)
{
return $this->call('unpinChatMessage', [
'chat_id' => $chatId
'chat_id' => $chatId,
'message_id' => $messageId,
]);
}

Expand Down

0 comments on commit d66f4cf

Please sign in to comment.