This repository was archived by the owner on Dec 23, 2024. It is now read-only.
Add method to set the History TTL#681
Open
ColinShark wants to merge 6 commits intopyrogram:masterfrom
Open
Conversation
`app.set_history_ttl(chat_id, period)` to automatically delete messages after either a day or a week. 0 to disable.
delivrance
suggested changes
May 14, 2021
Member
|
I'm also not fully convinced about keeping "TTL" in the convenience API, but at the moment I can't think of a better and short enough replacement. |
`set_history_ttl` -> `set_chat_history_ttl` in all occurences
(Still the original name ha!)
delivrance
reviewed
May 15, 2021
| elif isinstance(action, raw.types.MessageActionInviteToGroupCall): | ||
| voice_chat_members_invited = types.VoiceChatMembersInvited._parse(client, action, users) | ||
| service_type = "voice_chat_members_invited" | ||
| elif isinstance(action, raw.types.MessageActionSetMessagesTTL): |
Member
There was a problem hiding this comment.
Reading this made me think that maybe we should rename the whole thing to set_chat_messages_ttl or just set_chat_ttl since the feature applies to new messages not to the whole history (or can be seen as a global chat setting regardless of messages or history). What do you think? There's also a ttl_period field for messages (see the raw Message object) which I guess it will be set for all new messages when ttl is enabled.
Member
There was a problem hiding this comment.
So, set_chat_ttl(), Chat.set_ttl(), Message.chat_ttl_period.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
app.set_history_ttl(chat_id, period)to automatically delete messages after either a day (86400) or a week (604800).0to disable.