def load_cogs(): cogs = list_cogs() for cogs in cogs: try: bot.load_extension(cogs) print ("Load {}".format(cogs)) except Exception as e: utils.prRed(cogs) utils.prRed(e)
def load_cogs(): cogs = list_cogs() for cogs in cogs: try: bot.load_extension(cogs) print("Load {}".format(cogs)) except Exception as e: utils.prRed(cogs) utils.prRed(e)
def load_cogs(): raw_cogs = list_cogs() for cogs in raw_cogs: try: bot.load_extension(cogs) print(f"Load {cogs}") except Exception as e: utils.prRed(cogs) utils.prRed(e)
async def say_edit(msg): try: key = str(inspect.getmodule(inspect.currentframe().f_back.f_code)) regex = re.compile(r"(cogs.[a-zA-Z]*)") get = re.search(regex, key) if get: check = await bot.db.redis.hgetall("{}:Config:Delete_MSG".format( get_channel("_internal_channel").server.id)) check = check.get(get.groups()[0][5:]) await bot.say(msg, delete_after=check_post(check)) return except: utils.prRed(traceback.format_exc())
async def on_error(event, *args, **kwargs): print(event) print(args) print(kwargs) Current_Time = datetime.datetime.utcnow().strftime("%b/%d/%Y %H:%M:%S UTC") utils.prRed(Current_Time) utils.prRed("Error!") utils.prRed(traceback.format_exc()) error = '```py\n{}\n```'.format(traceback.format_exc()) try: # await bot.owner.send(f"```py\n{Current_Time}\nERROR!\n{error}```") await bot.error_channel.send( f"```py\n{Current_Time}\nERROR!\n{error}```") except: utils.prRed("Unable to send to owner/channel!")
async def on_error(event, *args, **kwargs): Current_Time = datetime.datetime.utcnow().strftime("%b/%d/%Y %H:%M:%S UTC") utils.prRed(Current_Time) utils.prRed("Error!") utils.prRed(traceback.format_exc()) error = '```py\n{}\n```'.format(traceback.format_exc()) await bot.send_message( bot.owner, "```py\n{}```".format(Current_Time + "\n" + "ERROR!") + "\n" + error)
async def on_error(event,*args,**kwargs): print(event) print(args) print(kwargs) Current_Time = datetime.datetime.utcnow().strftime("%b/%d/%Y %H:%M:%S UTC") utils.prRed(Current_Time) utils.prRed("Error!") utils.prRed(traceback.format_exc()) error = '```py\n{}\n```'.format(traceback.format_exc()) await bot.owner.send("```py\n{}```".format(Current_Time + "\n"+ "ERROR!") + "\n" + error)