Changed version API requests
This commit is contained in:
parent
af24a055b6
commit
98ac531a36
12
yusarin.py
12
yusarin.py
@ -25,12 +25,14 @@ if (
|
|||||||
|
|
||||||
if loadJson("config.json")["check_for_updates"]:
|
if loadJson("config.json")["check_for_updates"]:
|
||||||
try:
|
try:
|
||||||
serv_ver = loads(
|
release = loads(
|
||||||
get("https://api.end-play.xyz/version?app=yusarinbot&apikey=publickey").text
|
get(
|
||||||
)["version"]
|
"https://git.end-play.xyz/api/v1/repos/profitroll/YusarinBot/releases?draft=false&pre-release=false&page=1&limit=1"
|
||||||
if float(serv_ver) > version:
|
).json()
|
||||||
|
)[0]
|
||||||
|
if float(release["tag_name"].replace("v", "")) > version:
|
||||||
appendLog(
|
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)}")
|
appendLog(f"Currently using YusarinBot v{str(version)}")
|
||||||
except Exception as exp:
|
except Exception as exp:
|
||||||
|
Loading…
Reference in New Issue
Block a user