diff --git a/app/bot.php b/app/bot.php index 887c579..16bab3c 100644 --- a/app/bot.php +++ b/app/bot.php @@ -4701,20 +4701,24 @@ DNS-over-HTTPS with IP: $c = $this->getPacConf(); $pubkey = file_get_contents('/config/dnstt/server.pub'); $text[] = "dnstt"; - $text[] = "
set the NS record for {$c['dnsttDomain']}: tns.{$c['domain']}\nset A record for tns.{$c['domain']}: {$this->ip}
"; - $text[] = "account: vpnbot:{$c['dnsttPassword']}"; - $text[] = "server name: {$c['dnsttDomain']}"; - $text[] = "public key: $pubkey"; + if (!empty($c['dnsttDomain']) && !empty($c['dnsttPassword'])) { + $text[] = "
set the NS record for {$c['dnsttDomain']}: tns.{$c['domain']}\nset A record for tns.{$c['domain']}: {$this->ip}
"; + $text[] = "account: vpnbot:{$c['dnsttPassword']}"; + $text[] = "server name: {$c['dnsttDomain']}"; + $text[] = "public key: $pubkey"; + $data[] = [ + [ + 'text' => $this->i18n('download pubkey'), + 'callback_data' => "/dnsttDownload", + ], + ]; + } else { + $text[] = "set subdomain and password"; + } $data[] = [ [ - 'text' => $this->i18n('download pubkey'), - 'callback_data' => "/dnsttDownload", - ], - ]; - $data[] = [ - [ - 'text' => $this->i18n('set domain'), + 'text' => $this->i18n('set subdomain'), 'callback_data' => "/dnsttDomain", ], ];