1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

added only_if_banned to unban_chat_member

This commit is contained in:
Badiboy
2020-11-18 02:22:52 +03:00
parent bd27645965
commit 5824d47590
3 changed files with 7 additions and 3 deletions

View File

@ -700,9 +700,11 @@ def kick_chat_member(token, chat_id, user_id, until_date=None):
return _make_request(token, method_url, params=payload, method='post')
def unban_chat_member(token, chat_id, user_id):
def unban_chat_member(token, chat_id, user_id, only_if_banned):
method_url = 'unbanChatMember'
payload = {'chat_id': chat_id, 'user_id': user_id}
if only_if_banned:
payload['only_if_banned'] = only_if_banned
return _make_request(token, method_url, params=payload, method='post')