File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,9 +289,23 @@ async def download_dashboard(
289289 )
290290 except BaseException as _ :
291291 if latest :
292- dashboard_release_url = "https://github.com/AstrBotDevs/AstrBot/releases/latest/download/dist.zip"
292+ # Resolve latest release tag from GitHub API to construct correct asset URL
293+ ssl_context = ssl .create_default_context (cafile = certifi .where ())
294+ async with aiohttp .ClientSession (
295+ connector = aiohttp .TCPConnector (ssl = ssl_context ),
296+ trust_env = True ,
297+ ) as session :
298+ async with session .get (
299+ "https://api.github.com/repos/AstrBotDevs/AstrBot/releases/latest" ,
300+ timeout = 30 ,
301+ headers = {"Accept" : "application/vnd.github+json" },
302+ ) as api_resp :
303+ api_resp .raise_for_status ()
304+ release_data = await api_resp .json ()
305+ tag = release_data ["tag_name" ]
293306 else :
294- dashboard_release_url = f"https://github.com/AstrBotDevs/AstrBot/releases/download/{ version } /dist.zip"
307+ tag = version
308+ dashboard_release_url = f"https://github.com/AstrBotDevs/AstrBot/releases/download/{ tag } /AstrBot-{ tag } -dashboard.zip"
295309 if proxy :
296310 dashboard_release_url = f"{ proxy } /{ dashboard_release_url } "
297311 await download_file (
You can’t perform that action at this time.
0 commit comments