mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 09:05:04 +08:00
38 lines
792 B
Python
38 lines
792 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from ipaddress import IPv4Address
|
|
from typing import Set, Dict, Union, Optional
|
|
|
|
from pydantic import BaseSettings
|
|
|
|
|
|
class Env(BaseSettings):
|
|
environment: str = "prod"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
|
|
|
|
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:
|
|
env_file = ".env.prod"
|