Deploy on 2026-06-05 17:24:21

This commit is contained in:
Hamza-Ayed
2026-06-05 17:24:21 +03:00
parent d05e18b59d
commit 0657296c38
8 changed files with 311 additions and 22 deletions

View File

@@ -289,21 +289,27 @@ class Collector
// Trigger Telegram notification if enabled
if ($this->getSetting('telegram_enabled') === '1') {
$orgName = '';
if ($orgId) {
$orgStmt = $this->pdo->prepare("SELECT name FROM organizations WHERE id = ?");
$orgStmt->execute([$orgId]);
$orgName = $orgStmt->fetchColumn() ?: '';
$minScore = (int)($this->getSetting('telegram_min_score') ?: 75);
$oppType = $analysis['opportunity_type'] ?? $analysis['type'] ?? 'other';
$importantTypes = ['vc_funding', 'accelerator', 'incubator', 'grant', 'competition'];
if ($score >= $minScore && in_array($oppType, $importantTypes)) {
$orgName = '';
if ($orgId) {
$orgStmt = $this->pdo->prepare("SELECT name FROM organizations WHERE id = ?");
$orgStmt->execute([$orgId]);
$orgName = $orgStmt->fetchColumn() ?: '';
}
$this->notifier->loadSettings();
$this->notifier->notifyNewOpportunity([
'title' => $entry['title'],
'type' => $oppType,
'score' => $score,
'url' => $entry['url'],
'description' => $analysis['summary'] ?? $entry['description'],
'org_name' => $orgName,
]);
}
$this->notifier->loadSettings();
$this->notifier->notifyNewOpportunity([
'title' => $entry['title'],
'type' => $analysis['opportunity_type'] ?? $analysis['type'] ?? 'other',
'score' => $score,
'url' => $entry['url'],
'description' => $analysis['summary'] ?? $entry['description'],
'org_name' => $orgName,
]);
}
} catch (Throwable $e) {