summaryrefslogtreecommitdiff
path: root/ATRI/config.py
blob: 4a8ed10b5fab8b97c4c8ea627ec171fcd2f60ea8 (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
from pathlib import Path
from datetime import timedelta
from ipaddress import IPv4Address

from .utils.yaml import load_yml


CONFIG_PATH = Path('.') / 'config.yml'
config = load_yml(CONFIG_PATH)
nonebot_config = config['BotSelfConfig']


COPYRIGHT = """
 █████     ████████     ██████       ██
██   ██       ██        ██   ██      ██
███████       ██        ██████       ██
██   ██       ██        ██   ██      ██
██   ██       ██        ██   ██      ██
=========================================
Copyright © 2021 Kyomotoi, All Rights Reserved.
Project: https://github.com/Kyomotoi/ATRI
"""

VERSION = "YHN-001-A01"

RUNTIME_CONFIG = {
    "host": IPv4Address(nonebot_config.get('host', '127.0.0.1')),
    "port": int(nonebot_config.get('port', '8080')),
    "debug": bool(nonebot_config.get('debug', False)),
    "superusers": set(nonebot_config.get('superusers', ["1234567890"])),
    "nickname": set(
        nonebot_config.get(
            'nickname',
            ['ATRI', 'Atri', 'atri', '亚托莉', 'アトリ']
        )
    ),
    "command_start": set(nonebot_config.get('command_start', ['', '/'])),
    "command_sep": set(nonebot_config.get('command_sep', ['.'])),
    "session_expire_timeout": timedelta(
        nonebot_config.get('session_expire_timeout', 2)
    )
}