diff --git a/pyrogram/methods/chats/update_chat_notifications.py b/pyrogram/methods/chats/update_chat_notifications.py index 08e5640b..ce21458e 100644 --- a/pyrogram/methods/chats/update_chat_notifications.py +++ b/pyrogram/methods/chats/update_chat_notifications.py @@ -1,5 +1,4 @@ from typing import Union -from datetime import datetime, timedelta from pyrogram.raw.functions.account import UpdateNotifySettings from pyrogram.raw.types import InputNotifyPeer, InputPeerNotifySettings @@ -12,7 +11,7 @@ class UpdateChatNotifications(Scaffold): chat_id: Union[int, str], show_previews: bool = None, silent: bool = None, - mute_until: Union[int, datetime, timedelta] = None + mute_until: int = None ) -> bool: """Update the notification settings for the selected chat @@ -27,7 +26,7 @@ class UpdateChatNotifications(Scaffold): If the chat shall be muted. mute_until (``int`` | ``datetime.datetime`` | ``datetime.timdelta``, *optional*): - Unix timestamp, datetime or timedelta object that sets up when notifications shall be switched off. + When notifications shall be switched off. Unix time. Default to forever. Returns: @@ -52,13 +51,6 @@ class UpdateChatNotifications(Scaffold): app.update_chat_notifications(chat_id, silent=False) """ - if isinstance(mute_until, datetime): - mute_until = mute_until.timestamp() - - if isinstance(mute_until, timedelta): - now = datetime.now() - mute_until = now.timestamp() + mute_until.total_seconds() - peer = await self.resolve_peer(chat_id) r = await self.send(