Merge pull request #1026 from Badiboy/master

Bot API 5.0 pinning-unpinning logic post-fix.
This commit is contained in:
Badiboy 2020-11-29 16:11:46 +03:00 committed by GitHub
commit a4d0b685b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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')