88from discord .ext import commands as dcmd
99from dotenv import load_dotenv
1010
11- import teapot # import teapot.py core
11+ import teapot # import teapot.py core
1212
13- print ("""
13+ print (f """
1414 _____ _
1515 |_ _|__ __ _ _ __ ___ | |_
1616 | |/ _ \\ / _` | '_ \\ / _ \\ | __|
3535 if not versionlisted :
3636 print ("You are currently using an unlisted version!\n " )
3737elif req .status_code == 404 :
38- # 404 Not Found
38+ # 404 Not Found
3939 print ("Latest Teapot.py version not found!\n " )
4040elif req .status_code == 500 :
41- # 500 Internal Server Error
41+ # 500 Internal Server Error
4242 print ("An error occurred while fetching the latest Teapot.py version. [500 Internal Server Error]\n " )
4343elif req .status_code == 502 :
44- # 502 Bad Gateway
44+ # 502 Bad Gateway
4545 print ("An error occurred while fetching the latest Teapot.py version. [502 Bad Gateway]\n " )
4646elif req .status_code == 503 :
47- # 503 Service Unavailable
47+ # 503 Service Unavailable
4848 print ("An error occurred while fetching the latest Teapot.py version. [503 Service Unavailable]\n " )
4949else :
5050 print ("An unknown error has occurred when fetching the latest Teapot.py version\n " )
5454
5555if os .getenv ('CONFIG_VERSION' ) != teapot .config_version ():
5656 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." )
5858 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
6161
6262print ("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
6464 time_start = time .perf_counter ()
6565 database = teapot .managers .database .__init__ ()
6666 db = teapot .managers .database .db (database )
@@ -101,9 +101,11 @@ async def on_ready():
101101 for guild in bot .guilds :
102102 teapot .managers .database .create_guild_table (guild )
103103 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
105105 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+
107109
108110try :
109111 discord_time_start = time .perf_counter ()
@@ -114,4 +116,4 @@ async def on_ready():
114116 db .execute ("INSERT INTO `bot_logs`(timestamp, type, class, message) VALUES(%s, %s, %s, %s)" ,
115117 (teapot .time (), "ERROR" , __name__ , e ))
116118 time .sleep (5 )
117- exit (1 )
119+ exit (1 )
0 commit comments