|
|
@@ -24,7 +24,6 @@ use Telegram\Bot\Api;
|
|
|
use Telegram\Bot\Exceptions\TelegramSDKException;
|
|
|
use Telegram\Bot\FileUpload\InputFile;
|
|
|
use Telegram\Bot\Objects\BotCommand;
|
|
|
-use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
class Home extends Controller
|
|
|
{
|
|
|
@@ -155,19 +154,15 @@ class Home extends Controller
|
|
|
// 设置 Webhook
|
|
|
$webhookUrl = url('/api/onMessage'); // Webhook URL,指向刚才定义的路由
|
|
|
|
|
|
- $allowed_updates = [
|
|
|
- 'message', 'callback_query',
|
|
|
-// 'message_reaction', 'message_reaction_count',
|
|
|
-// 'removed_chat_boost', 'chat_boost',
|
|
|
-// 'chat_join_request', 'chat_member'
|
|
|
- ];
|
|
|
- $res = $telegram->setWebhook(['url' => $webhookUrl, 'allowed_updates' => $allowed_updates, 'drop_pending_updates' => true]);
|
|
|
+ $res = $telegram->setWebhook([
|
|
|
+ 'url' => $webhookUrl,
|
|
|
+ 'allowed_updates' => ['message', 'edited_message', 'channel_post', 'edited_channel_post', 'callback_query'],
|
|
|
+ ]);
|
|
|
|
|
|
} catch (TelegramSDKException $e) {
|
|
|
return $this->error($e->getCode(), $e->getMessage());
|
|
|
}
|
|
|
- Log::info('Telegram 回调数据(JSON): ' . json_encode([123454], JSON_UNESCAPED_UNICODE));
|
|
|
return $this->success($res);
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
+}
|