blob: 1d3afbe7fb2da78fdd251b697d52bfd4b6d73a9a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
'''
@File : main.py
@Time : 2021/02/02 15:51:44
@Author : Kyomotoi
@Contact : [email protected]
@Github : https://github.com/Kyomotoi
@License : Copyright © 2018-2021 Kyomotoi, All Rights Reserved.
'''
__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 RUNTIME_CONFIG, COPYRIGHT, VERSION
try:
width, height = get_terminal_size()
except OSError:
width, height = 0, 0
nonebot.init(**RUNTIME_CONFIG)
app = nonebot.get_asgi()
driver = nonebot.get_driver()
driver.register_adapter("cqhttp", CQHTTPBot)
nonebot.load_plugins('ATRI/plugins')
if __name__ == "__main__":
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')
|