mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Documentation Bug fixed
This commit is contained in:
parent
5a03ab62d0
commit
555257a3fe
@ -1668,8 +1668,7 @@ class TeleBot:
|
|||||||
return apihelper.set_chat_administrator_custom_title(self.token, chat_id, user_id, custom_title)
|
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],
|
def ban_chat_sender_chat(self, chat_id: Union[int, str], sender_chat_id: Union[int, str]) -> bool:
|
||||||
until_date:Optional[Union[int, datetime]]=None) -> bool:
|
|
||||||
"""
|
"""
|
||||||
Use this method to ban a channel chat in a supergroup or a channel.
|
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
|
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.
|
or less than 30 seconds from the current time they are considered to be banned forever.
|
||||||
:return: True on success.
|
: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:
|
def unban_chat_sender_chat(self, chat_id: Union[int, str], sender_chat_id: Union[int, str]) -> bool:
|
||||||
"""
|
"""
|
||||||
|
@ -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')
|
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'
|
method_url = 'banChatSenderChat'
|
||||||
payload = {'chat_id': chat_id, 'sender_chat_id': sender_chat_id}
|
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')
|
return _make_request(token, method_url, params=payload, method='post')
|
||||||
|
|
||||||
|
|
||||||
|
@ -2136,8 +2136,7 @@ class AsyncTeleBot:
|
|||||||
return await asyncio_helper.set_chat_administrator_custom_title(self.token, chat_id, user_id, custom_title)
|
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],
|
async def ban_chat_sender_chat(self, chat_id: Union[int, str], sender_chat_id: Union[int, str]) -> bool:
|
||||||
until_date:Optional[Union[int, datetime]]=None) -> bool:
|
|
||||||
"""
|
"""
|
||||||
Use this method to ban a channel chat in a supergroup or a channel.
|
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
|
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.
|
or less than 30 seconds from the current time they are considered to be banned forever.
|
||||||
:return: True on success.
|
: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:
|
async def unban_chat_sender_chat(self, chat_id: Union[int, str], sender_chat_id: Union[int, str]) -> bool:
|
||||||
"""
|
"""
|
||||||
|
@ -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')
|
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'
|
method_url = 'banChatSenderChat'
|
||||||
payload = {'chat_id': chat_id, 'sender_chat_id': sender_chat_id}
|
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')
|
return await _process_request(token, method_url, params=payload, method='post')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user