add http api

This commit is contained in:
yanyongyu
2020-08-01 22:03:40 +08:00
parent a39c2e223a
commit b3f82f3f22
6 changed files with 70 additions and 14 deletions

View File

@ -1,8 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import Set, Union
from ipaddress import IPv4Address
from typing import Set, Dict, Union, Optional
from pydantic import BaseSettings
@ -15,14 +15,22 @@ class Env(BaseSettings):
class Config(BaseSettings):
# nonebot configs
driver: str = "nonebot.drivers.fastapi"
host: IPv4Address = IPv4Address("127.0.0.1")
port: int = 8080
secret: Optional[str] = None
debug: bool = False
# bot connection configs
api_root: Dict[int, str] = {}
access_token: Optional[str] = None
# bot runtime configs
superusers: Set[int] = set()
nickname: Union[str, Set[str]] = ""
# custom configs
custom_config: dict = {}
class Config: