update_chat_notifications()#
- Client.update_chat_notifications()#
Update the notification settings for the selected chat
- Parameters:
chat_id (
int
|str
) – Unique identifier (int) or username (str) of the target chat.mute (
bool
, optional) – Pass True if you want to mute chat.until_date (
datetime
, optional) – Date when the user will be unmuted. Works only if the mute parameter is set to True. Defaults to forever.stories_muted (
bool
, optional) – N/Astories_hide_sender (
bool
, optional) – N/Ashow_previews (
bool
, optional) – If the text of the message shall be displayed in notification.
- Returns:
bool
– True on success, False otherwise.
Example
# Mute a chat permanently app.update_chat_notifications(chat_id, mute=True) # Mute a chat for 10 minutes app.update_chat_notifications( chat_id, mute=True mute_until=datetime.timedelta(minutes=10) ) # Unmute a chat app.update_chat_notifications(chat_id, mute=False)