From edc877f149ee3bc1a4921ec6d6e0364e0bc7d4b2 Mon Sep 17 00:00:00 2001 From: mercury Date: Wed, 13 Nov 2024 01:08:25 +0400 Subject: [PATCH] limit message for scanner --- app/bot.php | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/app/bot.php b/app/bot.php index faba5a5..988c355 100644 --- a/app/bot.php +++ b/app/bot.php @@ -4280,24 +4280,27 @@ DNS-over-HTTPS with IP: $ips[$k] = $v; } } + $i = 0; if (!empty($ips)) { foreach ($ips as $k => $v) { - if (!in_array($k, $pac['deny'] ?: [])) { - $comment = implode(', ', array_unique($v)); - if (!empty($return)) { - $ret[$k] = $v; - } else { - $this->send($this->input['from'], "$k $comment\n", button: [[ - [ - 'text' => $this->i18n('search'), - 'callback_data' => "/searchIp $k", - ], - [ - 'text' => $this->i18n('disallow'), - 'callback_data' => "/denyIp $k", - ], - ]]); - } + if ($i > 20) { + break; + } + $comment = implode(', ', array_unique($v)); + if (!empty($return)) { + $ret[$k] = $v; + } else { + $this->send($this->input['from'], "$k $comment\n", button: [[ + [ + 'text' => $this->i18n('search'), + 'callback_data' => "/searchIp $k", + ], + [ + 'text' => $this->i18n('disallow'), + 'callback_data' => "/denyIp $k", + ], + ]]); + $i++; } } if (!empty($return)) {