From 00c9351f83ddff17e0b4c88d380f8cbfcb90d6f0 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 29 Nov 2020 15:12:14 +0300 Subject: [PATCH] Hotfix 0a2216a22bf89b8f3482462109270b6e9c048e04 * message_id made optional as API declares --- telebot/__init__.py | 2 +- telebot/apihelper.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/telebot/__init__.py b/telebot/__init__.py index f151195..4f59e04 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -1239,7 +1239,7 @@ class TeleBot: """ return apihelper.pin_chat_message(self.token, chat_id, message_id, disable_notification) - def unpin_chat_message(self, chat_id, message_id): + def unpin_chat_message(self, chat_id, message_id=None): """ Use this method to unpin specific pinned message in a supergroup chat. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. diff --git a/telebot/apihelper.py b/telebot/apihelper.py index b43d341..1cc57ab 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -830,7 +830,7 @@ def pin_chat_message(token, chat_id, message_id, disable_notification=None): return _make_request(token, method_url, params=payload, method='post') -def unpin_chat_message(token, chat_id, message_id): +def unpin_chat_message(token, chat_id, message_id=None): method_url = 'unpinChatMessage' payload = {'chat_id': chat_id, 'message_id': message_id} return _make_request(token, method_url, params=payload, method='post')