Changed version API requests

This commit is contained in:
Profitroll 2023-03-22 21:09:09 +01:00
parent af24a055b6
commit 98ac531a36

View File

@ -25,12 +25,14 @@ if (
if loadJson("config.json")["check_for_updates"]:
try:
serv_ver = loads(
get("https://api.end-play.xyz/version?app=yusarinbot&apikey=publickey").text
)["version"]
if float(serv_ver) > version:
release = loads(
get(
"https://git.end-play.xyz/api/v1/repos/profitroll/YusarinBot/releases?draft=false&pre-release=false&page=1&limit=1"
).json()
)[0]
if float(release["tag_name"].replace("v", "")) > version:
appendLog(
f"YusarinBot version {serv_ver} is available. Download new version here: https://git.end-play.xyz/profitroll/YusarinBot/releases/latest"
f"YusarinBot version {release['tag_name']} is available. Download new version here: {release['html_url']}"
)
appendLog(f"Currently using YusarinBot v{str(version)}")
except Exception as exp: