diff --git a/telebot/__init__.py b/telebot/__init__.py index f30a9db..d1ff2c2 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -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: """ diff --git a/telebot/apihelper.py b/telebot/apihelper.py index 6a38b67..229fa78 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -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') diff --git a/telebot/async_telebot.py b/telebot/async_telebot.py index 176d2b9..782ba6d 100644 --- a/telebot/async_telebot.py +++ b/telebot/async_telebot.py @@ -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: """ diff --git a/telebot/asyncio_helper.py b/telebot/asyncio_helper.py index 1fcf47f..0360b09 100644 --- a/telebot/asyncio_helper.py +++ b/telebot/asyncio_helper.py @@ -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')