From 17e27beb598d9aeb40614252fc4e528741fce4fc Mon Sep 17 00:00:00 2001 From: h Date: Mon, 19 Oct 2026 01:51:48 +0000 Subject: [PATCH] fix(userbot): repeated link rows no longer abort the message insert --- backend/src/userbot/modules/links/repository.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/userbot/modules/links/repository.py b/backend/src/userbot/modules/links/repository.py index 0fc4e6f..8db6489 100644 --- a/backend/src/userbot/modules/links/repository.py +++ b/backend/src/userbot/modules/links/repository.py @@ -7,6 +7,14 @@ INSERT INTO links (account_id, chat_id, message_id, position, url, kind, web_url, web_title, web_description, web_site_name, raw) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11::jsonb) +ON CONFLICT (account_id, chat_id, message_id, position) DO UPDATE SET + url = EXCLUDED.url, + kind = EXCLUDED.kind, + web_url = EXCLUDED.web_url, + web_title = EXCLUDED.web_title, + web_description = EXCLUDED.web_description, + web_site_name = EXCLUDED.web_site_name, + raw = EXCLUDED.raw """