File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 11import os
22import time
33from os .path import join , dirname
4+ import json
5+ import requests
46
57import discord
68from discord .ext import commands as dcmd
1921Running Teapot.py { teapot .version ()}
2022""" )
2123
24+ req = requests .get (f'https://api.github.com/repos/RedCokeDevelopment/Teapot.py/tags' )
25+ response = json .loads (req .text )
26+ if req .status_code == 200 :
27+ if response [0 ]['name' ] == teapot .version ():
28+ print ("You are currently running the latest version of Teapot.py!\n " )
29+ else :
30+ versionlisted = False
31+ for x in response :
32+ if x ['name' ] == teapot .version ():
33+ versionlisted = True
34+ print ("You are not using our latest version! :(\n " )
35+ if not versionlisted :
36+ print ("You are currently using an unlisted version!\n " )
37+ elif req .status_code == 404 :
38+ print ("Unable to fetch the latest Teapot.py version from GitHub!\n " )
39+ else :
40+ print ("An unknown error has occurred when fetching the latest version of Teapot.py\n " )
41+
2242load_dotenv (join (dirname (__file__ ), '.env' ))
2343
2444if os .getenv ('CONFIG_VERSION' ) != teapot .config_version ():
You can’t perform that action at this time.
0 commit comments