fix: reject unconfirmed Telegram tests and invalid update responses
This commit is contained in:
+4
-2
@@ -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'){
|
||||
|
||||
Reference in New Issue
Block a user