diff --git a/app/Console/Commands/PriceChannelTest.php b/app/Console/Commands/PriceChannelTest.php index c50d08c..ec2612c 100644 --- a/app/Console/Commands/PriceChannelTest.php +++ b/app/Console/Commands/PriceChannelTest.php @@ -17,6 +17,7 @@ class PriceChannelTest extends Command $this->line(''); $this->info('=== وضعیت ارسال قیمت به کانال ==='); + $this->line('دسترسی دیپلوی (price_channel_access): ' . (($info['access'] ?? false) ? 'بله' : 'خیر')); $this->line('قابلیت روشن (price_channel_enabled): ' . ($info['enabled'] ? 'بله' : 'خیر')); $this->line('پیام‌رسان‌های انتخاب‌شده: ' . (implode(', ', $info['selected_messengers']) ?: '— (خالی)')); $this->line('حداقل فاصله ارسال (ثانیه): ' . $info['min_seconds']); @@ -79,6 +80,10 @@ class PriceChannelTest extends Command { $blocked = false; + if (! ($info['access'] ?? false)) { + $this->warn('⚠ price_channel_access خاموش است — در تنظیمات پیشرفته روشنش کن.'); + $blocked = true; + } if (! $info['enabled']) { $this->warn('⚠ price_channel_enabled خاموش است — روشنش کن.'); $blocked = true; diff --git a/app/Services/PriceChannelBroadcastService.php b/app/Services/PriceChannelBroadcastService.php index bb169f0..ae360dd 100644 --- a/app/Services/PriceChannelBroadcastService.php +++ b/app/Services/PriceChannelBroadcastService.php @@ -786,11 +786,13 @@ TXT; private function sendTelegram(string $token, string $chatId, string $message): \Illuminate\Http\Client\Response { + // تلگرام مستقیم از سرور اغلب فیلتر است — از پروکسی wwwapp استفاده می‌شود (مثل کد قدیمی) return Http::withOptions(Controller::httpClientOptions()) ->timeout(6) - ->post("https://api.telegram.org/bot{$token}/sendMessage", [ - 'chat_id' => $chatId, - 'text' => $message, + ->get('https://api.wwwapp.ir/telegran_send.php', [ + 'chatId' => $chatId, + 'message' => $message, + 'botToken' => $token, ]); } @@ -862,12 +864,12 @@ TXT; return max(0, $minSeconds - (now()->timestamp - $lastSent)); } - /** @return array */ private function hasPriceChannelAccess(): bool { return $this->config->getBool('price_channel_access', false); } + /** @return array */ private function parseList(string $raw): array { $parts = preg_split('/[,\n]+/', trim($raw)) ?: [];