к предыдущему

This commit is contained in:
kislovdm
2026-04-10 19:09:15 +03:00
parent 763ca45ab2
commit 70f1cea78e
2 changed files with 9 additions and 6 deletions
+3 -3
View File
@@ -132,8 +132,8 @@ class TelegramClient:
payload: dict[str, Any] = {
"timeout": timeout,
"limit": limit,
# чтобы получать посты из каналов (channel_post) и обычные сообщения
"allowed_updates": ["message", "edited_message", "channel_post", "edited_channel_post"],
# Реагируем только на новые сообщения/посты (текст, фото, видео).
"allowed_updates": ["message", "channel_post"],
}
if offset is not None:
payload["offset"] = offset
@@ -145,7 +145,7 @@ class TelegramClient:
# Важно: не делаем getUpdates нигде больше (иначе 409 Conflict).
# Наполняем кэш чатов только из этого потока.
for upd in updates:
for container in ("message", "edited_message", "channel_post", "edited_channel_post"):
for container in ("message", "channel_post"):
msg = upd.get(container)
if not isinstance(msg, dict):
continue