diff options
Diffstat (limited to 'ATRI/__init__.py')
-rw-r--r-- | ATRI/__init__.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/ATRI/__init__.py b/ATRI/__init__.py new file mode 100644 index 0000000..4458ad8 --- /dev/null +++ b/ATRI/__init__.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 +# -*- coding:utf-8 -*- +''' +File: __init__.py +Created Date: 2021-03-07 11:22:06 +Author: Kyomotoi +Email: [email protected] +License: GPLv3 +Project: https://github.com/Kyomotoi/ATRI +-------- +Last Modified: Sunday, 7th March 2021 3:01:51 pm +Modified By: Kyomotoi ([email protected]) +-------- +Copyright (c) 2021 Kyomotoi +''' + +from time import sleep + +import nonebot as nb +from nonebot.adapters.cqhttp import Bot as ATRIBot + +from .config import RUNTIME_CONFIG +from .log import logger + + +__version__ = "YHN-001-A01" + + +def asgi(): + return nb.get_asgi() + + +def init(): + nb.init(**RUNTIME_CONFIG) + driver = nb.get_driver() + driver.register_adapter("cqhttp", ATRIBot) + nb.load_plugins('ATRI/plugins') + logger.info(f"Now running: {__version__}") + sleep(3) + + +def run(app): + nb.run(app=app) |