📦 插件商店上新:liteyukibot-plugin-htmlrender及liteyukibot-plugin-lagrange

This commit is contained in:
snowy 2024-08-24 11:39:10 +08:00
parent 93c287bbd9
commit ebe0c5bcbb
6 changed files with 88 additions and 74 deletions

View File

@ -38,5 +38,58 @@
"type": "application",
"valid": true,
"version": "rolling"
},
{
"module_name": "liteyukibot-plugin-lagrange",
"project_link": "liteyukibot-plugin-lagrange",
"name": "LagrangePlugin",
"desc": "在轻雪中使用lagrange-python",
"author": "snowykami",
"homepage": "https://github.com/snowykami/liteyukibot-plugin-lagrange",
"tags": [
{
"label": "app",
"color": "#aeeaa8"
},
{
"label": "lagrange",
"color": "#ff89f7"
}
],
"is_official": true,
"type": "application",
"valid": true,
"version": "rolling"
},
{
"module_name": "liteyukibot-plugin-htmlrender",
"project_link": "liteyukibot-plugin-htmlrender",
"name": "htmlrender",
"desc": "使用系统中的浏览器对网页进行渲染,便于其他插件使用",
"author": "EillesWan",
"homepage": "https://github.com/LiteyukiStudio/liteyukibot-plugin-htmlrender",
"tags": [
{
"label": "ch",
"color": "#4285f4"
},
{
"label": "ro",
"color": "#db4437"
},
{
"label": "mi",
"color": "#f4b400"
},
{
"label": "um",
"color": "#0f9d58"
}
],
"is_official": true,
"type": "application",
"valid": true,
"version": "rolling"
}
]

View File

@ -11,56 +11,16 @@
import os
import json
import copy
import platform
from typing import Any, List
import toml
import yaml
from pydantic import BaseModel
from typing import Any
from liteyuki.log import logger
_SUPPORTED_CONFIG_FORMATS = (".yaml", ".yml", ".json", ".toml")
# 以下这三个 Config 和 src/utils/base/config.py 中重复
# 应尽快整理
class SatoriNodeConfig(BaseModel):
host: str = ""
port: str = "5500"
path: str = ""
token: str = ""
class SatoriConfig(BaseModel):
comment: str = (
"These features are still in development. Do not enable in production environment."
)
enable: bool = False
hosts: List[SatoriNodeConfig] = [SatoriNodeConfig()]
class BasicConfig(BaseModel):
host: str = "127.0.0.1"
port: int = 20216
superusers: list[str] = []
command_start: list[str] = ["/", ""]
nickname: list[str] = [f"LiteyukiBot"]
satori: SatoriConfig = SatoriConfig()
data_path: str = "data/liteyuki"
chromium_path: str = (
"/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome" # type: ignore
if platform.system() == "Darwin"
else (
"C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
if platform.system() == "Windows"
else "/usr/bin/chromium-browser"
)
)
def flat_config(config: dict[str, Any]) -> dict[str, Any]:
"""
扁平化配置文件

0
liteyuki/py.typed Normal file
View File

View File

@ -7,7 +7,8 @@ from cpuinfo import cpuinfo
from nonebot import require
from nonebot.adapters import satori
from src.utils import __NAME__, __VERSION__
from src.utils import __NAME__
from liteyuki import __version__
from src.utils.base.config import get_config
from src.utils.base.data_manager import TempConfig, common_db
from src.utils.base.language import Language