mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 09:21:46 +08:00 
			
		
		
		
	update telegram
This commit is contained in:
		| @@ -21,13 +21,17 @@ class ConfigController extends Controller | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     public function setTelegramWebhook() | ||||
|     public function setTelegramWebhook(Request $request) | ||||
|     { | ||||
|         $telegramService = new TelegramService(); | ||||
|         $telegramService = new TelegramService($request->input('telegram_bot_token')); | ||||
|         if (!$telegramService->getMe()) { | ||||
|             abort(500, '机器人Token有误'); | ||||
|         } | ||||
|         if (!$telegramService->setWebhook(config('v2board.app_url') . '/api/v1/guest/telegram/webhook?access_token=' . md5(config('v2board.telegram_bot_token')))) { | ||||
|         if (!$telegramService->setWebhook( | ||||
|             config('v2board.app_url') | ||||
|             . '/api/v1/guest/telegram/webhook?access_token=' | ||||
|             . md5(config('v2board.telegram_bot_token', $request->input('telegram_bot_token'))) | ||||
|         )) { | ||||
|             abort(500, 'Webhook设置失败'); | ||||
|         } | ||||
|         return response([ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user