8
8
from discord .ext import commands as dcmd
9
9
from dotenv import load_dotenv
10
10
11
- import teapot # import teapot.py core
11
+ import teapot # import teapot.py core
12
12
13
- print ("""
13
+ print (f """
14
14
_____ _
15
15
|_ _|__ __ _ _ __ ___ | |_
16
16
| |/ _ \\ / _` | '_ \\ / _ \\ | __|
35
35
if not versionlisted :
36
36
print ("You are currently using an unlisted version!\n " )
37
37
elif req .status_code == 404 :
38
- # 404 Not Found
38
+ # 404 Not Found
39
39
print ("Latest Teapot.py version not found!\n " )
40
40
elif req .status_code == 500 :
41
- # 500 Internal Server Error
41
+ # 500 Internal Server Error
42
42
print ("An error occurred while fetching the latest Teapot.py version. [500 Internal Server Error]\n " )
43
43
elif req .status_code == 502 :
44
- # 502 Bad Gateway
44
+ # 502 Bad Gateway
45
45
print ("An error occurred while fetching the latest Teapot.py version. [502 Bad Gateway]\n " )
46
46
elif req .status_code == 503 :
47
- # 503 Service Unavailable
47
+ # 503 Service Unavailable
48
48
print ("An error occurred while fetching the latest Teapot.py version. [503 Service Unavailable]\n " )
49
49
else :
50
50
print ("An unknown error has occurred when fetching the latest Teapot.py version\n " )
54
54
55
55
if os .getenv ('CONFIG_VERSION' ) != teapot .config_version ():
56
56
if os .path .isfile ('.env' ):
57
- print ("Missing environment variables. Please backup and delete .env, then run Teapot.py again." )
57
+ print ("Missing environment variables. Please backup and delete .env, then run Teapot.py again." )
58
58
quit (2 )
59
- print ("Unable to find required environment variables. Running setup.py..." ) # if .env not found
60
- teapot .setup .__init__ () # run setup.py
59
+ print ("Unable to find required environment variables. Running setup.py..." ) # if .env not found
60
+ teapot .setup .__init__ () # run setup.py
61
61
62
62
print ("Initializing bot..." )
63
- if teapot .config .storage_type () == "mysql" : # if .env use mysql, create the table if table not exists
63
+ if teapot .config .storage_type () == "mysql" : # if .env use mysql, create the table if table not exists
64
64
time_start = time .perf_counter ()
65
65
database = teapot .managers .database .__init__ ()
66
66
db = teapot .managers .database .db (database )
@@ -101,9 +101,11 @@ async def on_ready():
101
101
for guild in bot .guilds :
102
102
teapot .managers .database .create_guild_table (guild )
103
103
elif teapot .config .storage_type () == "sqlite" :
104
- print ("[!] Warning: SQLite storage has not been implemented yet. MySQL database is recommended" ) # WIP
104
+ print ("[!] Warning: SQLite storage has not been implemented yet. MySQL database is recommended" ) # WIP
105
105
print (f"Registered commands and events in { round (time .perf_counter () - time_start , 2 )} s" )
106
- await bot .change_presence (status = discord .Status .online , activity = discord .Game (teapot .config .bot_status ())) # Update Bot status
106
+ await bot .change_presence (status = discord .Status .online ,
107
+ activity = discord .Game (teapot .config .bot_status ())) # Update Bot status
108
+
107
109
108
110
try :
109
111
discord_time_start = time .perf_counter ()
@@ -114,4 +116,4 @@ async def on_ready():
114
116
db .execute ("INSERT INTO `bot_logs`(timestamp, type, class, message) VALUES(%s, %s, %s, %s)" ,
115
117
(teapot .time (), "ERROR" , __name__ , e ))
116
118
time .sleep (5 )
117
- exit (1 )
119
+ exit (1 )
0 commit comments