3 Commits

Author SHA1 Message Date
7f1f86ca03 Fixed update checker behavior 2023-03-22 21:26:05 +01:00
c600747848 Bump py-cord to 2.4.1 2023-03-22 21:09:58 +01:00
a2bd55dcdf Updated version to 1.9 2023-03-22 21:09:32 +01:00
3 changed files with 9 additions and 11 deletions

View File

@@ -1,2 +1,2 @@
ujson~=5.7.0 ujson~=5.7.0
py-cord[speed]~=2.3.2 py-cord[speed]~=2.4.1

View File

@@ -1,2 +1,2 @@
py-cord~=2.3.2 py-cord~=2.4.1
requests~=2.28.2 requests~=2.28.2

View File

@@ -12,7 +12,7 @@ from os import getpid
from functions import * from functions import *
pid = getpid() pid = getpid()
version = 1.8 version = 1.9
if ( if (
loadJson("config.json")["owner"] == "SET-OWNER-ID" loadJson("config.json")["owner"] == "SET-OWNER-ID"
@@ -24,17 +24,15 @@ if (
exit() exit()
if loadJson("config.json")["check_for_updates"]: if loadJson("config.json")["check_for_updates"]:
appendLog(f"Currently using YusarinBot v{str(version)}")
try: try:
release = loads( releases = get(
get( "https://git.end-play.xyz/api/v1/repos/profitroll/YusarinBot/releases?draft=false&pre-release=false&page=1&limit=1"
"https://git.end-play.xyz/api/v1/repos/profitroll/YusarinBot/releases?draft=false&pre-release=false&page=1&limit=1" ).json()
).json() if float(releases[0]["tag_name"].replace("v", "")) > version:
)[0]
if float(release["tag_name"].replace("v", "")) > version:
appendLog( 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: except Exception as exp:
appendLog( appendLog(
f"Could not get YusarinBot cloud version due to {exp}. Currently using {str(version)}" f"Could not get YusarinBot cloud version due to {exp}. Currently using {str(version)}"