| | |
| | | await db.upsert_user(u.id, u.username, u.first_name, u.last_name, ts) |
| | | except Exception as e: |
| | | logger.warning("upsert_user failed user=%s: %s", u.id, e) |
| | | # Лог последних сообщений для панели. |
| | | if chat and chat.type in ("group", "supergroup") and u is not None and not u.is_bot: |
| | | content = event.text or event.caption or "" |
| | | if content: |
| | | try: |
| | | await db.add_msg(chat.id, u.id, u.full_name, content[:1000], ts) |
| | | except Exception as e: |
| | | logger.warning("add_msg failed chat=%s: %s", chat.id, e) |
| | | return await handler(event, data) |
| | | |
| | | |