summaryrefslogtreecommitdiff
path: root/ATRI/configs/models.py
blob: f0248283f06cc97f3ee49221eefcc3699ca44e21 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from typing import List, Optional
from pydantic import BaseModel


class BotConfig(BaseModel):
    host: str
    port: int
    debug: bool
    superusers: set
    nickname: set
    command_start: set
    command_sep: set
    session_expire_timeout: int
    access_token: str
    proxy: str
    request_timeout: int


class GoCQHTTPAccountList(BaseModel):
    uin: int
    password: str
    protocol: int


class WithGoCQHTTP(BaseModel):
    enabled: bool
    accounts: Optional[List[GoCQHTTPAccountList]]
    download_domain: str
    download_version: str
    gocq_webui_username: str
    gocq_webui_password: str


class SauceNAO(BaseModel):
    key: str


class Setu(BaseModel):
    reverse_proxy: bool
    reverse_proxy_domain: str


class GeoIP(BaseModel):
    account_id: int
    license_key: str


class ConfigModel(BaseModel):
    ConfigVersion: str
    BotConfig: BotConfig
    WithGoCQHTTP: WithGoCQHTTP
    SauceNAO: SauceNAO
    Setu: Setu
    GeoIP: GeoIP


class RuntimeConfig(BaseModel):
    host: str
    port: int
    debug: bool
    superusers: set
    nickname: set
    onebot_access_token: str
    command_start: set
    command_sep: set
    session_expire_timeout: int
    gocq_accounts: Optional[list]
    gocq_download_domain: str
    gocq_version: str
    gocq_webui_username: str
    gocq_webui_password: str