diff --git a/telebot/apihelper.py b/telebot/apihelper.py index 1cc57ab..2fe3a7d 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -830,9 +830,11 @@ 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=None): +def unpin_chat_message(token, chat_id, message_id): method_url = 'unpinChatMessage' - payload = {'chat_id': chat_id, 'message_id': message_id} + payload = {'chat_id': chat_id} + if message_id: + payload['message_id'] = message_id return _make_request(token, method_url, params=payload, method='post')