30 lines
434 B
Python
30 lines
434 B
Python
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)
|