Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add the feature to delete on special edits #133

Merged
merged 1 commit into from
May 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tgcf/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Forward(BaseModel):

class LiveSettings(BaseModel):
delete_sync: bool = False
delete_on_edit: Optional[str] = None


class PastSettings(BaseModel):
Expand Down
6 changes: 5 additions & 1 deletion tgcf/live.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ async def edited_message_handler(event):

if fwded_msgs:
for msg in fwded_msgs:
await msg.edit(message.text)
if CONFIG.live.delete_on_edit == message.text:
await msg.delete()
await message.delete()
else:
await msg.edit(message.text)
return

to_send_to = from_to.get(event.chat_id)
Expand Down