agent = $agent; } public function agent(): ?User { return $this->agent; } public function isOfficial(): bool { return $this->agent === null; } public function isAgent(): bool { return $this->agent !== null; } public function expectedChatId(): string { if ($this->agent !== null) { return trim((string) ($this->agent->chat_id ?? '')); } return trim((string) config('coruna.telegram.owner_chat_id', '')); } public static function webhookSecretFor(User $agent): string { return hash_hmac('sha256', 'telegram-agent:'.$agent->id, (string) config('app.key')); } }