nonsensebot/app/__main__.py

26 lines
445 B
Python
Raw Normal View History

2024-07-28 03:59:19 +01:00
import click
import logging
from tortoise import run_async
log = logging.getLogger(__name__)
@click.group()
def cli():
logging.basicConfig(level=logging.INFO)
@cli.command()
def run():
"""Runs the bot"""
log.info("Starting bot.")
2024-07-28 23:33:15 +01:00
logging.getLogger("nio.rooms").setLevel(logging.WARNING)
2024-07-28 03:59:19 +01:00
from .main import bot
2024-07-28 23:33:15 +01:00
2024-07-28 03:59:19 +01:00
run_async(bot.start(access_token=bot.cfg["bot"]["access_token"]))
if __name__ == "__main__":
cli()