INNER CODE UNIT · JavaScript
result
ruwiss/ai-auto-free · ai-auto-free/backend/index.js:684
const result = await telegramLog.sendNotificationLog(message, details || null);
if (result) {
res.json({ success: true, message: "Notification sent successfully" });
} else {
// Başarısız olduğunda
throw new Error("Telegram mesaj gönderme başarısız");
}
} catch (error) {
console.error("Bildirim gönderme hatası:", error);
// Hatayı admin kanalına logla
telegramLog.sendAdminLog("Bildirim Gönderme Hatası", `UserID: ${req.user?.uuid || "Bilinmiyor"}\nHata: ${error.message}`);
res.status(500).json({ error: "Notification sending failed" });
}
});
// Gift kodu oluşturma endpoint'i