try:
async for message in client.iter_messages(chat_id, min_id=0, max_id=0, offset_id=0, offset_date=0, add_offset=0, limit=None):
if type(message) == MessageService: service_messages.append(message.id)
await client.delete_messages(chat_id, service_messages)
await client.delete_dialog(chat_id)
except Exception as e:
logger.error(f"{e.__class__}: {e} | {session_name} {chat_id}")
Why doesn't this code delete all service messages?
https://stackoverflow.com/questions/44555613/telethon-delete-a-message
That's not the point, I don't get all the service messages (and messages).
History of actions: First, an account is invited, then messages are deleted from this account.
if service_messages is not filled with the messages you expect, the account just doesn't have access to the chat's messages, and toggle useless arguments in iter_messages. they're optional and have default values
Обсуждают сегодня