mirror of
https://github.com/paul-nameless/tg
synced 2025-02-16 18:48:24 +00:00
Update delete msgs handler
This commit is contained in:
parent
ae1d58d12f
commit
03edec303e
1 changed files with 2 additions and 7 deletions
|
@ -241,13 +241,8 @@ def update_message_content_opened(
|
|||
def update_delete_msgs(controller: Controller, update: Dict[str, Any]):
|
||||
chat_id = update["chat_id"]
|
||||
msg_ids = update["message_ids"]
|
||||
msgs = controller.model.msgs.msgs[chat_id]
|
||||
to_remove = []
|
||||
for msg in msgs:
|
||||
if msg["id"] in msg_ids:
|
||||
to_remove.append(msg)
|
||||
for msg in to_remove:
|
||||
msgs.remove(msg)
|
||||
for msg_id in msg_ids:
|
||||
controller.model.msgs.remove_message(chat_id, msg_id)
|
||||
controller.render_msgs()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue