mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 13:36:30 +03:00
Simplify process_messages() in echo bot
This commit is contained in:
@@ -27,12 +27,8 @@ async def main():
|
||||
await deltachat.start_io()
|
||||
|
||||
async def process_messages():
|
||||
fresh_messages = await account.get_fresh_messages()
|
||||
fresh_message_snapshot_tasks = [
|
||||
message.get_snapshot() for message in fresh_messages
|
||||
]
|
||||
fresh_message_snapshots = await asyncio.gather(*fresh_message_snapshot_tasks)
|
||||
for snapshot in fresh_message_snapshots:
|
||||
for message in await account.get_fresh_messages_in_arrival_order():
|
||||
snapshot = await message.get_snapshot()
|
||||
if not snapshot.is_info:
|
||||
await snapshot.chat.send_text(snapshot.text)
|
||||
await snapshot.message.mark_seen()
|
||||
|
||||
Reference in New Issue
Block a user