From c44ce437b9f53abc02077f04caef11ceee69597c Mon Sep 17 00:00:00 2001 From: Matt Compton Date: Mon, 31 Jan 2022 16:33:03 +0000 Subject: [PATCH] whoo imports --- bot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bot.py b/bot.py index 2c50377..e855b43 100644 --- a/bot.py +++ b/bot.py @@ -1,5 +1,6 @@ # Stdlib import os +from datetime import datetime # Pip import discord @@ -38,14 +39,13 @@ async def distrohop(ctx, *, count=None): async def on_ready(): chan = bot.get_channel(842491569176051712) cogs_dir = "cogs" - for extension in [ - f.replace(".py", "") for f in os.listdir(cogs_dir) if os.path.isfile(os.path.join(cogs_dir, f)) - ]: + for extension in [f.replace(".py", "") for f in os.listdir(cogs_dir) if os.path.isfile(os.path.join(cogs_dir, f))]: try: bot.load_extension(cogs_dir + "." + extension) except (Exception) as e: - await chan.send(f"Failed to load extension {extension}.") - await chan.send("Started/restarted at: `" + getstamp() + "`") + await chan.send(f"Failed to load extension `{extension}`.") + + await chan.send("Started/restarted at: `" + str(datetime.now()) + "`") if not os.path.exists(os.environ["HOME"] + "/.cavetoken"): print("No token found")