fix: reject unconfirmed Telegram tests and invalid update responses

This commit is contained in:
2026-09-06 14:55:05 +03:00
parent 37fb7b0366
commit 120657758c
8 changed files with 57 additions and 6 deletions
+4 -2
View File
@@ -911,8 +911,10 @@ const server = http.createServer(async (req, res) => {
const body = await readBody(req);
if (body.islem === 'test') {
if (!tg?.chatId) return json(res, 400, { success: false, error: 'Telegram bağlı değil' });
await sendTelegram(tg.chatId, '✅ İhaleist bağlantı testi — bildirimler bu sohbete gelecek.');
return json(res, 200, { success: true });
if(!telegramConfigured())return json(res,503,{success:false,error:'Telegram hizmeti etkin değil.'});
const receipt=await sendTelegram(tg.chatId,'✅ İhaleist bağlantı testi.',{parseMode:null,returnReceipt:true});
if(!receipt?.id)throw new Error('Telegram gönderim kabulü doğrulanamadı.');
return json(res,200,{success:true,id:receipt.id});
}
const linker=createTelegramLinker(store);
if(body.islem==='kod'){