from .lib_on_loop import slowmode
from .lib_on_loop import record_vcin
from .lib_on_loop import record_users
from .lib_on_loop import record_channels
from .lib_on_loop import delete_users
from .lib_on_loop import remove_old_messages
#from .lib_on_loop import exec_down
from fw import log
from fw import core

#120秒ごと
async def on_120():
    try:
        #DBからユーザーを論理削除する
        await delete_users.on_event()
        
    except Exception as e:
        print(e)
        log.e(str(e))
        raise e

    return

#60秒ごと
async def on_60():
    try:
        #古いメッセージを消す
        await remove_old_messages.on_event()

    except Exception as e:
        print(e)
        log.e(str(e))
        raise e
    return

#30秒ごと
async def on_30():
    try:
        #ユーザー情報を記録する
        await record_users.on_event()
        
        #チャンネル情報を記録する
        await record_channels.on_event()
    
        #低速モード実行する
        await slowmode.on_event()
        
        #DBにVC入室時間を記録する
        await record_vcin.on_event()
    
    except Exception as e:
        print(e)
        log.e(str(e))
        raise e
    return

#10秒ごと
async def on_10():

    return
