fix(userbot): encode absent pyrogram raw payloads as empty json

This commit is contained in:
hh committed 2026-09-06 21:26:13 +02:00
1 parent 6a6e63ff75
commit 676680319b
15 files changed
+63 -25

No files matched your search

@@ -6,6 +6,7 @@ from userbot.modules.capture.context import CaptureContext
from userbot.modules.links import extract_links
from userbot.modules.links import repository as links_repository
from userbot.modules.media import capture_media, self_destruct_ttl
from userbot.modules.raw_json import raw_json
from utils.policy.models import CaptureToggles
@@ -47,7 +48,7 @@ async def capture_message(
message.date,
sender_id(message),
message.text or message.caption,
str(message),
raw_json(message),
has_media=message.media is not None,
is_self_destruct=self_destruct_ttl(message) is not None,
)
@@ -68,5 +69,5 @@ async def capture_message(
links = extract_links(message)
if links:
await links_repository.insert_links(
ctx.pool, ctx.account_id, chat_id, message.id, links, str(message)
ctx.pool, ctx.account_id, chat_id, message.id, links, raw_json(message)
)