summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2021-01-26 18:43:13 +0800
committerKyomotoi <[email protected]>2021-01-26 18:43:13 +0800
commit7640568a42493bc5a5e44bc82b1ecfa87e51c5f1 (patch)
tree60f29b756d58b085c95573515d3e4bd6f41426a8 /main.py
parentd0d31b2630697c97e848f00142f06b81f63b255a (diff)
downloadATRI-7640568a42493bc5a5e44bc82b1ecfa87e51c5f1.tar.gz
ATRI-7640568a42493bc5a5e44bc82b1ecfa87e51c5f1.tar.bz2
ATRI-7640568a42493bc5a5e44bc82b1ecfa87e51c5f1.zip
[Update]
Diffstat (limited to 'main.py')
-rw-r--r--main.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/main.py b/main.py
index 3a2b27e..648e571 100644
--- a/main.py
+++ b/main.py
@@ -1,8 +1,9 @@
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
+
'''
@File : main.py
-@Time : 2020/12/18 18:07:07
+@Time : 2021/01/23 12:49:54
@Author : Kyomotoi
@Contact : [email protected]
@Github : https://github.com/Kyomotoi
@@ -10,30 +11,29 @@
'''
__author__ = 'kyomotoi'
+from time import sleep
+from os import get_terminal_size
+
import nonebot
from nonebot.adapters.cqhttp import Bot as CQHTTPBot
-from ATRI.log import logger
-from ATRI.config import NONEBOT_CONFIG, CheckConfig
+from nonebot.log import logger
+from ATRI.config import COPYRIGHT, RUNTIME_CONFIG, VERSION
-copyright = ("""
-====================[ATRI | アトリ]====================
-* Mirai + NoneBot2 + Python
-* Copyright © 2018-2020 Kyomotoi,All Rights Reserved
-* Project: https://github.com/Kyomotoi/ATRI
-* Docs: https://kyomotoi.github.io/ATRI/#
-* Version: YHN-00A-001
-=======================================================""")
-CheckConfig()
+try:
+ width, height = get_terminal_size()
+except OSError:
+ width, height = 0, 0
-nonebot.init(**NONEBOT_CONFIG)
+nonebot.init(**RUNTIME_CONFIG)
app = nonebot.get_asgi()
driver = nonebot.get_driver()
-driver.register_adapter("cqhttp", CQHTTPBot) # type: ignore
+driver.register_adapter("cqhttp", CQHTTPBot)
nonebot.load_plugins('ATRI/plugins')
if __name__ == "__main__":
- logger.info(copyright)
- logger.info('Running ATRI...')
- nonebot.run(app='main:app') \ No newline at end of file
+ logger.warning("\n".join(i.center(width) for i in COPYRIGHT.splitlines()))
+ logger.info(f"Now running: {VERSION}")
+ sleep(3)
+ nonebot.run(app='main:app')