whoo imports

pull/1/head
Matt Compton 3 years ago
parent 2cca803caf
commit c44ce437b9

@ -1,5 +1,6 @@
# Stdlib # Stdlib
import os import os
from datetime import datetime
# Pip # Pip
import discord import discord
@ -38,14 +39,13 @@ async def distrohop(ctx, *, count=None):
async def on_ready(): async def on_ready():
chan = bot.get_channel(842491569176051712) chan = bot.get_channel(842491569176051712)
cogs_dir = "cogs" cogs_dir = "cogs"
for extension in [ for extension in [f.replace(".py", "") for f in os.listdir(cogs_dir) if os.path.isfile(os.path.join(cogs_dir, f))]:
f.replace(".py", "") for f in os.listdir(cogs_dir) if os.path.isfile(os.path.join(cogs_dir, f))
]:
try: try:
bot.load_extension(cogs_dir + "." + extension) bot.load_extension(cogs_dir + "." + extension)
except (Exception) as e: except (Exception) as e:
await chan.send(f"Failed to load extension {extension}.") await chan.send(f"Failed to load extension `{extension}`.")
await chan.send("Started/restarted at: `" + getstamp() + "`")
await chan.send("Started/restarted at: `" + str(datetime.now()) + "`")
if not os.path.exists(os.environ["HOME"] + "/.cavetoken"): if not os.path.exists(os.environ["HOME"] + "/.cavetoken"):
print("No token found") print("No token found")

Loading…
Cancel
Save