Почему мне вебхук ничего не возвращает?
Пробовал на живом сервере, пробовал через опрос.
Вот код:
web.php
Route::post('/telebot/webhook/bot/{token}', [TelegramBotAdmarController::class, 'webhook']);
telebot.php
'bots' => [
'admar' => [
'token' => env('TELEGRAM_BOT_TOKEN'),
'name' => env('TELEGRAM_BOT_NAME', null),
'api_url' => env('TELEGRAM_API_URL', 'https://api.telegram.org/bot{TOKEN}/{METHOD}'),
'exceptions' => true,
'async' => false,
'webhook' => [
'url' => env(
'TELEGRAM_BOT_WEBHOOK_URL',
env('APP_URL') . '/telebot/webhook/bot/' . env('TELEGRAM_BOT_TOKEN')
),
// 'certificate' => env('TELEGRAM_BOT_CERT_PATH', storage_path('app/ssl/public.pem')),
// 'ip_address' => '8.8.8.8',
// 'max_connections' => 40,
// 'allowed_updates' => ["message", "edited_channel_post", "callback_query"],
// 'secret_token' => env('TELEGRAM_KEY', null),
],
'poll' => [
'limit' => 100,
'timeout' => 0,
'allowed_updates' => ["message", "edited_channel_post", "callback_query"]
],
'handlers' => [
// Your update handlers
],
],
TelegramBotAdmarController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use WeStacks\TeleBot\Laravel\TeleBot;
use function MongoDB\BSON\toJSON;
class TelegramBotAdmarController extends Controller
{
public function webhook($token)
{
$test = TeleBot::bot('admar')->handleUpdate();
Log::info('message', (array)$test);
}
public function updateMessage()
{
$handler = function (TeleBot $bot, Update $update, $next) {
if ($update->message->text === '/start') {
return $bot->sendMessage([
'chat_id' => $update->chat()->id,
'text' => 'Hello, World!'
]);
}
return $next();
};
Log::info('telegbot - ' . toJSON($handler));
}
}
Но почему-то не могу ничего написать в лог.