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 1
1
import os
2
2
import time
3
3
from os .path import join , dirname
4
+ import json
5
+ import requests
4
6
5
7
import discord
6
8
from discord .ext import commands as dcmd
19
21
Running Teapot.py { teapot .version ()}
20
22
""" )
21
23
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
+
22
42
load_dotenv (join (dirname (__file__ ), '.env' ))
23
43
24
44
if os .getenv ('CONFIG_VERSION' ) != teapot .config_version ():
You can’t perform that action at this time.
0 commit comments