Exemplo n.º 1
0
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)
Exemplo n.º 2
0
Arquivo: bot.py Projeto: ki2n/Nurevam
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
Arquivo: bot.py Projeto: ki2n/Nurevam
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())
Exemplo n.º 5
0
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!")
Exemplo n.º 6
0
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)
Exemplo n.º 7
0
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)