Skip to content

Commit 962a552

Browse files
committed
chore: detecting message changes
1 parent ebc27e8 commit 962a552

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ public.pem
2020
*.session
2121
parser.json
2222
test_site.py
23+
my_account.session-journal

pyrogram_parser.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,17 @@ async def new_message_handler(client, message):
106106
if message.text or message.caption:
107107
message_save = StructureMessage.model_validate(message, from_attributes=True)
108108
await send_to_server(message_save)
109-
# saveJson(message)
109+
110+
111+
# Handler for edited messages in the specified chats
112+
@app.on_edited_message(
113+
filters.chat(["@sportinIU", "@opportunitiesforyou", "@test_kanal_capstone"])
114+
)
115+
async def edited_message_handler(client, message):
116+
"""the process for the message that was changed"""
117+
if message.text or message.caption:
118+
message_save = StructureMessage.model_validate(message, from_attributes=True)
119+
await send_to_server(message_save)
110120

111121

112122
if __name__ == "__main__":

0 commit comments

Comments
 (0)