Fixed update checker behavior
This commit is contained in:
parent
c600747848
commit
7f1f86ca03
10
yusarin.py
10
yusarin.py
@ -24,17 +24,15 @@ if (
|
||||
exit()
|
||||
|
||||
if loadJson("config.json")["check_for_updates"]:
|
||||
appendLog(f"Currently using YusarinBot v{str(version)}")
|
||||
try:
|
||||
release = loads(
|
||||
get(
|
||||
releases = 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:
|
||||
if float(releases[0]["tag_name"].replace("v", "")) > version:
|
||||
appendLog(
|
||||
f"YusarinBot version {release['tag_name']} is available. Download new version here: {release['html_url']}"
|
||||
f"YusarinBot version {releases[0]['tag_name']} is available. Download new version here: {releases[0]['html_url']}"
|
||||
)
|
||||
appendLog(f"Currently using YusarinBot v{str(version)}")
|
||||
except Exception as exp:
|
||||
appendLog(
|
||||
f"Could not get YusarinBot cloud version due to {exp}. Currently using {str(version)}"
|
||||
|
Loading…
Reference in New Issue
Block a user