From 005065549944381112bda677ee321bc4faf35afe Mon Sep 17 00:00:00 2001 From: Simon <65854503+StopmotionSimonYT@users.noreply.github.com> Date: Tue, 9 Aug 2022 20:03:37 +0200 Subject: [PATCH] Add version check in utils folder --- utils/version.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 utils/version.py diff --git a/utils/version.py b/utils/version.py new file mode 100644 index 0000000..3042c0c --- /dev/null +++ b/utils/version.py @@ -0,0 +1,11 @@ +import requests +from utils.console import print_step + +def checkversion(__VERSION__): + response = requests.get("https://api.github.com/repos/elebumm/RedditVideoMakerBot/releases/latest") + latestversion = (response.json()["tag_name"]) + if __VERSION__ == latestversion: + print_step(f"You are using the newest version ({__VERSION__}) of the bot") + return True + else: + print_step(f"You are using an older version ({__VERSION__}) of the bot. Download the newest version ({latestversion}) from https://github.com/elebumm/RedditVideoMakerBot/releases/latest") \ No newline at end of file