2021-01-30 05:58:30 +08:00
|
|
|
from typing import Optional
|
2021-11-22 23:21:26 +08:00
|
|
|
from ipaddress import IPv4Address
|
2021-01-30 05:58:30 +08:00
|
|
|
|
2021-11-22 23:21:26 +08:00
|
|
|
from pydantic import Extra, Field, BaseModel
|
2021-01-30 05:58:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
class Config(BaseModel):
|
2021-02-01 01:04:30 +08:00
|
|
|
"""
|
|
|
|
Mirai 配置类
|
|
|
|
|
|
|
|
:必填:
|
|
|
|
|
2021-02-05 13:31:33 +08:00
|
|
|
- ``auth_key`` / ``mirai_auth_key``: mirai-api-http 的 auth_key
|
|
|
|
- ``mirai_host``: mirai-api-http 的地址
|
|
|
|
- ``mirai_port``: mirai-api-http 的端口
|
2021-02-01 01:04:30 +08:00
|
|
|
"""
|
2021-11-22 23:21:26 +08:00
|
|
|
|
|
|
|
auth_key: Optional[str] = Field(None, alias="mirai_auth_key")
|
|
|
|
host: Optional[IPv4Address] = Field(None, alias="mirai_host")
|
|
|
|
port: Optional[int] = Field(None, alias="mirai_port")
|
2021-01-30 05:58:30 +08:00
|
|
|
|
|
|
|
class Config:
|
|
|
|
extra = Extra.ignore
|
2021-03-16 16:17:34 +08:00
|
|
|
allow_population_by_field_name = True
|