Fixed another thingy regarding borked paths.
This commit is contained in:
parent
ba27d7c390
commit
6f7e3b4bbc
@ -26,6 +26,8 @@ from .shared_libs.loggable import Loggable
|
|||||||
# Init logging to output on INFO level to stderr.
|
# Init logging to output on INFO level to stderr.
|
||||||
logging.basicConfig(level="INFO")
|
logging.basicConfig(level="INFO")
|
||||||
|
|
||||||
|
REBOOT_FILE = "sebimachine/config/reboot"
|
||||||
|
|
||||||
|
|
||||||
# If uvloop is installed, change to that eventloop policy as it
|
# If uvloop is installed, change to that eventloop policy as it
|
||||||
# is more efficient
|
# is more efficient
|
||||||
@ -88,17 +90,18 @@ class SebiMachine(commands.Bot, LoadConfig, Loggable):
|
|||||||
async def on_ready(self):
|
async def on_ready(self):
|
||||||
"""On ready function"""
|
"""On ready function"""
|
||||||
self.maintenance and self.logger.warning("MAINTENANCE ACTIVE")
|
self.maintenance and self.logger.warning("MAINTENANCE ACTIVE")
|
||||||
with open(f"src/config/reboot", "r") as f:
|
if os.path.exists(REBOOT_FILE):
|
||||||
reboot = f.readlines()
|
with open(REBOOT_FILE, "r") as f:
|
||||||
if int(reboot[0]) == 1:
|
reboot = f.readlines()
|
||||||
await self.get_channel(int(reboot[1])).send("Restart Finished.")
|
if int(reboot[0]) == 1:
|
||||||
for cog, ex in self.failed_cogs_on_startup.items():
|
await self.get_channel(int(reboot[1])).send("Restart Finished.")
|
||||||
tb = ''.join(traceback.format_exception(type(ex), ex, ex.__traceback__))[-1500:]
|
for cog, ex in self.failed_cogs_on_startup.items():
|
||||||
await ctx.send(
|
tb = ''.join(traceback.format_exception(type(ex), ex, ex.__traceback__))[-1500:]
|
||||||
f'FAILED TO LOAD {cog} BECAUSE OF {type(ex).__name__}: {ex}\n'
|
await ctx.send(
|
||||||
f'{tb}'
|
f'FAILED TO LOAD {cog} BECAUSE OF {type(ex).__name__}: {ex}\n'
|
||||||
)
|
f'{tb}'
|
||||||
with open(f"src/config/reboot", "w") as f:
|
)
|
||||||
|
with open(REBOOT_FILE, "w") as f:
|
||||||
f.write(f"0")
|
f.write(f"0")
|
||||||
|
|
||||||
async def on_command_error(self, ctx, error):
|
async def on_command_error(self, ctx, error):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user