Documentation Bug fixed

This commit is contained in:
_run 2021-12-08 14:00:39 +05:00
parent 5a03ab62d0
commit 555257a3fe
4 changed files with 6 additions and 12 deletions

View File

@ -1668,8 +1668,7 @@ class TeleBot:
return apihelper.set_chat_administrator_custom_title(self.token, chat_id, user_id, custom_title)
def ban_chat_sender_chat(self, chat_id: Union[int, str], sender_chat_id: Union[int, str],
until_date:Optional[Union[int, datetime]]=None) -> bool:
def ban_chat_sender_chat(self, chat_id: Union[int, str], sender_chat_id: Union[int, str]) -> bool:
"""
Use this method to ban a channel chat in a supergroup or a channel.
The owner of the chat will not be able to send messages and join live
@ -1685,7 +1684,7 @@ class TeleBot:
or less than 30 seconds from the current time they are considered to be banned forever.
:return: True on success.
"""
return apihelper.ban_chat_sender_chat(self.token, chat_id, sender_chat_id, until_date)
return apihelper.ban_chat_sender_chat(self.token, chat_id, sender_chat_id)
def unban_chat_sender_chat(self, chat_id: Union[int, str], sender_chat_id: Union[int, str]) -> bool:
"""

View File

@ -969,11 +969,9 @@ def set_chat_administrator_custom_title(token, chat_id, user_id, custom_title):
return _make_request(token, method_url, params=payload, method='post')
def ban_chat_sender_chat(token, chat_id, sender_chat_id, until_date=None):
def ban_chat_sender_chat(token, chat_id, sender_chat_id):
method_url = 'banChatSenderChat'
payload = {'chat_id': chat_id, 'sender_chat_id': sender_chat_id}
if until_date:
payload['until_date'] = until_date
return _make_request(token, method_url, params=payload, method='post')

View File

@ -2136,8 +2136,7 @@ class AsyncTeleBot:
return await asyncio_helper.set_chat_administrator_custom_title(self.token, chat_id, user_id, custom_title)
async def ban_chat_sender_chat(self, chat_id: Union[int, str], sender_chat_id: Union[int, str],
until_date:Optional[Union[int, datetime]]=None) -> bool:
async def ban_chat_sender_chat(self, chat_id: Union[int, str], sender_chat_id: Union[int, str]) -> bool:
"""
Use this method to ban a channel chat in a supergroup or a channel.
The owner of the chat will not be able to send messages and join live
@ -2153,7 +2152,7 @@ class AsyncTeleBot:
or less than 30 seconds from the current time they are considered to be banned forever.
:return: True on success.
"""
return await asyncio_helper.ban_chat_sender_chat(self.token, chat_id, sender_chat_id, until_date)
return await asyncio_helper.ban_chat_sender_chat(self.token, chat_id, sender_chat_id)
async def unban_chat_sender_chat(self, chat_id: Union[int, str], sender_chat_id: Union[int, str]) -> bool:
"""

View File

@ -912,11 +912,9 @@ async def set_chat_administrator_custom_title(token, chat_id, user_id, custom_ti
return await _process_request(token, method_url, params=payload, method='post')
async def ban_chat_sender_chat(token, chat_id, sender_chat_id, until_date=None):
async def ban_chat_sender_chat(token, chat_id, sender_chat_id):
method_url = 'banChatSenderChat'
payload = {'chat_id': chat_id, 'sender_chat_id': sender_chat_id}
if until_date:
payload['until_date'] = until_date
return await _process_request(token, method_url, params=payload, method='post')