From 969a36c2a8c4760d0c7d7b3ec9fdd44592e189f1 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 10 Aug 2019 09:06:05 +0200 Subject: [PATCH] Update docs for silent parameter Since it now also works in private chats to "not disturb friends" (see https://telegram.org/blog/silent-messages-slow-mode). --- telethon/client/messages.py | 7 ++++--- telethon/client/uploads.py | 7 ++++--- telethon/tl/custom/inlineresult.py | 5 ++++- telethon/tl/custom/message.py | 7 +++++-- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/telethon/client/messages.py b/telethon/client/messages.py index 2d61dc0b..5382ef6d 100644 --- a/telethon/client/messages.py +++ b/telethon/client/messages.py @@ -760,9 +760,10 @@ class MessageMethods: the entity from which the messages should be forwarded. silent (`bool`, optional): - Whether the message should notify people in a broadcast - channel or not. Defaults to `False`, which means it will - notify them. Set it to `True` to alter this behaviour. + Whether the message should notify people with sound or not. + Defaults to `False` (send with a notification sound unless + the person has the chat muted). Set it to `True` to alter + this behaviour. as_album (`bool`, optional): Whether several image messages should be forwarded as an diff --git a/telethon/client/uploads.py b/telethon/client/uploads.py index 68e7825d..00d932c9 100644 --- a/telethon/client/uploads.py +++ b/telethon/client/uploads.py @@ -217,9 +217,10 @@ class UploadMethods: :tl:`ReplyMarkup` here. silent (`bool`, optional): - Whether the message should notify people in a broadcast - channel or not. Defaults to `False`, which means it will - notify them. Set it to `True` to alter this behaviour. + Whether the message should notify people with sound or not. + Defaults to `False` (send with a notification sound unless + the person has the chat muted). Set it to `True` to alter + this behaviour. supports_streaming (`bool`, optional): Whether the sent video supports streaming or not. Note that diff --git a/telethon/tl/custom/inlineresult.py b/telethon/tl/custom/inlineresult.py index 4a411699..4d2d21e0 100644 --- a/telethon/tl/custom/inlineresult.py +++ b/telethon/tl/custom/inlineresult.py @@ -110,7 +110,10 @@ class InlineResult: If present, the sent message will reply to this ID or message. silent (`bool`, optional): - If `True`, the sent message will not notify the user(s). + Whether the message should notify people with sound or not. + Defaults to `False` (send with a notification sound unless + the person has the chat muted). Set it to `True` to alter + this behaviour. clear_draft (`bool`, optional): Whether the draft should be removed after sending the diff --git a/telethon/tl/custom/message.py b/telethon/tl/custom/message.py index 77743f0b..9e9ba2f9 100644 --- a/telethon/tl/custom/message.py +++ b/telethon/tl/custom/message.py @@ -44,9 +44,12 @@ class Message(ChatGetter, SenderGetter, TLObject, abc.ABC): Whether you have read the media in this message or not, e.g. listened to the voice note media. + silent (`bool`): - Whether this message should notify or not, - used in channels. + Whether the message should notify people with sound or not. + Previously used in channels, but since 9 August 2019, it can + also be `used in private chats + `_. post (`bool`): Whether this message is a post in a broadcast