コード例 #1
0
ファイル: bot.py プロジェクト: Maverun/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)
コード例 #2
0
ファイル: bot.py プロジェクト: 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)
コード例 #3
0
ファイル: bot.py プロジェクト: Maverun/Nurevam
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)
コード例 #4
0
ファイル: bot.py プロジェクト: 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())
コード例 #5
0
ファイル: bot.py プロジェクト: Maverun/Nurevam
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!")
コード例 #6
0
ファイル: bot.py プロジェクト: Thorgott2/Nurevam
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)
コード例 #7
0
ファイル: bot.py プロジェクト: Maverun/Nurevam
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)