feat(bot): ✨ Move background tasks to separate image.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import os
|
||||
|
||||
from payphone import bot
|
||||
from payphone.db import setup
|
||||
from payphone.core import config, logging
|
||||
|
||||
|
||||
bot = bot.bot
|
||||
|
||||
|
||||
bot.shard_ids = [config.SHARD_ID]
|
||||
bot.shard_count = config.SHARD_COUNT
|
||||
|
||||
|
||||
logging.setup("Payphone")
|
||||
|
||||
|
||||
async def init() -> None:
|
||||
"""Initializes the DB."""
|
||||
|
||||
if config.SHARD_ID == 0:
|
||||
os.system("aerich upgrade")
|
||||
|
||||
await setup.init()
|
||||
|
||||
|
||||
bot.loop.run_until_complete(init())
|
||||
|
||||
bot.run(config.TOKEN)
|
||||
Reference in New Issue
Block a user