diff --git a/.dockerignore b/.dockerignore deleted file mode 100755 index e69de29b..00000000 diff --git a/.domain b/.domain deleted file mode 100644 index 1dfd2603..00000000 --- a/.domain +++ /dev/null @@ -1,2 +0,0 @@ -bot.liteyuki.icu -docs.app.bot.pages.git.liteyuki.icu diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100755 index 3ba13e0c..00000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1 +0,0 @@ -blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/resource_publish_en.yml b/.github/ISSUE_TEMPLATE/resource_publish_en.yml deleted file mode 100755 index 2233c1cd..00000000 --- a/.github/ISSUE_TEMPLATE/resource_publish_en.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Publish Resource -title: "Resource: {name}" -description: Publish the resource to the LiteyukiBot official store -labels: [ "Resource" ] -body: - - type: input - id: name - attributes: - label: Name - description: The readable name of the resource pack - placeholder: e.g. Cute UI Resource Pack - validations: - required: true - - - type: input - id: description - attributes: - label: Description - description: A brief description of the resource - placeholder: e.g. Makes the rendering card style more beautiful - validations: - required: true - - - type: input - id: author - attributes: - label: Author - description: The GitHub username of the author - placeholder: e.g. snowykami - validations: - required: true - - - type: input - id: link - attributes: - label: Link - description: Direct download link of the resource pack - placeholder: e.g. https://aaa.com/r.zip - validations: - required: true - - - type: input - id: homepage - attributes: - label: Homepage - description: Homepage of the resource pack - placeholder: e.g. https://github.com/user/repo - validations: - required: false - - - type: input - id: tags - attributes: - label: Tags - description: Tags - placeholder: 'e.g. [{"label": "Tag Name", "color": "#ea5252"}]' - value: '[ { "label": "Text", "color": "#a2d8f4" } ]' - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/resource_publish_zh.yml b/.github/ISSUE_TEMPLATE/resource_publish_zh.yml deleted file mode 100755 index 3a88db80..00000000 --- a/.github/ISSUE_TEMPLATE/resource_publish_zh.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: 发布资源 -title: "Resource: {name}" -description: 发布资源到轻雪机器人官方商店 -labels: [ "Resource" ] -body: - - type: input - id: name - attributes: - label: 名称 - description: 资源包的可读名称 - placeholder: e.g. 可爱UI资源包 - validations: - required: true - - - type: input - id: description - attributes: - label: 描述 - description: 资源的简短描述 - placeholder: e.g. 使渲染卡片的样式更美观 - validations: - required: true - - - type: input - id: author - attributes: - label: 作者 - description: 作者的github用户名 - placeholder: e.g. snowykami - validations: - required: true - - - type: input - id: link - attributes: - label: 下载链接 - description: 资源包直接下载链接 - placeholder: e.g. https://aaa.com/r.zip - validations: - required: true - - - type: input - id: homepage - attributes: - label: 主页 - description: 资源包主页 - placeholder: e.g. https://github.com/user/repo - validations: - required: false - - - type: input - id: tags - attributes: - label: 标签 - description: 标签 - placeholder: 'e.g. [{"label": "标签名", "color": "#ea5252"}]' - value: '[ { "label": "标签名", "color": "#a2d8f4" } ]' - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/问题反馈.md b/.github/ISSUE_TEMPLATE/问题反馈.md deleted file mode 100755 index 9c959836..00000000 --- a/.github/ISSUE_TEMPLATE/问题反馈.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -name: 问题反馈 -about: 反馈你在使用轻雪中遇到的问题 -title: '' -labels: '' -assignees: '' - ---- - -# 问题反馈 - -## **请确保** - -- 已认真阅读[文档]("https://bot.liteyuki.icu"),该问题不是文档提及的或你自己操作不当造成的 -- 你的问题是在最新版本的代码上测试的 -- 请勿重复提交相同或类似的issue - - -## **描述问题** - -请在此简单描述问题 - - - -## **如何复现** - -请阐述一下如何重现这个问题 -### 预期 - -描述你期望发生的事情 - -### 实际 - -描述实际发生的事情 - - - -## **日志或截图** -``` -日志内容 -``` - - -## **设备信息** -- **系统**: [例如 Ubuntu 22.04] -- **CPU**: [例如 Intel i7-7700K] -- **内存**: [例如 16GB] -- **Python**: [例如CPython 3.10.7] - - -**补充内容** - -可选,推荐提供`pip freeze`的输出,以及其他相关信息,以及你的建议 diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100755 index 121d32a9..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - -version: 2 -updates: - - package-ecosystem: "" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml deleted file mode 100755 index 4ee2e04b..00000000 --- a/.github/workflows/build-image.yml +++ /dev/null @@ -1,43 +0,0 @@ - -name: Docker Image Build - -on: - push: - branches: [main] - - workflow_dispatch: - -permissions: - contents: write - -concurrency: - group: docker-build - cancel-in-progress: false - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ secrets.GHCR_USERNAME }} - password: ${{ secrets.GHCR_PASSWORD }} - - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: ghcr.io/liteyukistudio/liteyukibot:latest - - - name: Log out from GitHub Container Registry - run: docker logout ghcr.io diff --git a/.github/workflows/deploy-docs-liteyukicloud.yml b/.github/workflows/deploy-docs-liteyukicloud.yml deleted file mode 100644 index 4057b6c2..00000000 --- a/.github/workflows/deploy-docs-liteyukicloud.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Deploy VitePress site to Liteyuki PaaS - -on: - push: - branches: [main] - workflow_dispatch: -permissions: - contents: write - statuses: write - -concurrency: - group: pages - cancel-in-progress: false - -env: - MELI_SITE: "800a7c09-dd9c-4ba7-a43f-af9bc69808c4" - -jobs: - # 构建工作 - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 # 如果未启用 lastUpdated,则不需要 - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: "3.11" - - - name: Setup API markdown - run: |- - python -m pip install litedoc - litedoc liteyuki -o docs/zh/dev/api -l zh-Hans -cd class -fd func -md func -vd var -bu https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/ - litedoc liteyuki -o docs/en/dev/api -l en -cd class -fd func -md func -vd var -bu https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/ - - - name: 安装 pnpm - uses: pnpm/action-setup@v2 - with: - run_install: true - version: 8 - - - name: 设置 Node.js - run: |- - cd docs - pnpm install - - - name: 构建文档 - env: - NODE_OPTIONS: --max_old_space_size=8192 - run: |- - cd docs - pnpm run docs:build - > .vitepress/dist/.nojekyll - - - name: "发布" - run: | - npx -p "@getmeli/cli" meli upload docs/.vitepress/dist \ - --url "https://pages.liteyuki.icu" \ - --site "$MELI_SITE" \ - --token "$MELI_TOKEN" \ - --release "$GITHUB_SHA" - env: - MELI_TOKEN: ${{ secrets.MELI_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/issue_handler.yml b/.github/workflows/issue_handler.yml deleted file mode 100755 index 5e8c7397..00000000 --- a/.github/workflows/issue_handler.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Issue Handler - -on: - issues: - types: [ opened, edited, closed ] - -concurrency: - group: issue_handler - cancel-in-progress: false - -jobs: - check-issue: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Check issue title - id: check_title - run: | - ISSUE_TITLE="${{ github.event.issue.title }}" - if [[ "$ISSUE_TITLE" == Plugin:* || "$ISSUE_TITLE" == Resource:* ]]; then - echo "Title starts with Plugin: or Resource:." - echo "::set-output name=title_match::true" - else - echo "Title does not start with Plugin: or Resource:." - echo "::set-output name=title_match::false" - fi - - - name: Set up Python - uses: actions/setup-python@v2 - if: steps.check_title.outputs.title_match == 'true' - with: - python-version: '3.12' - - - name: Install dependencies - if: steps.check_title.outputs.title_match == 'true' - run: | - echo "Installing dependencies." - pip install -r liteyuki_flow/requirements.txt - - - name: Run Plugin/Resource issue handler - if: steps.check_title.outputs.title_match == 'true' - run: | - echo "Running Plugin/Resource issue handler." - python -m liteyuki_flow --handle - env: - GITHUB_TOKEN: ${{ secrets.TOKEN }} - ISSUE_NUMBER: ${{ github.event.issue.number }} - REPOSITORY: ${{ github.repository }} - ACT_TYPE: ${{ github.event.action }} \ No newline at end of file diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100755 index 08fe4867..00000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Pre-commit checks - -on: [push, pull_request] - -jobs: - pre-commit: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.10', '3.11', '3.12', '3.13'] # 添加你想要测试的 Python 版本 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} # 使用矩阵中的 Python 版本 - - - name: Install dependencies - run: | - python -m pip install pdm - python -m pip install pre-commit - pdm config python.use_venv false - pdm install --no-lock - pre-commit install - - - name: Run pre-commit - run: pre-commit run --all-files diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml deleted file mode 100755 index 402eae8a..00000000 --- a/.github/workflows/pypi-publish.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Publish - -on: - push: - tags: - - 'v*' - -jobs: - pypi-publish: - name: upload release to PyPI - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@v3 - - - uses: pdm-project/setup-pdm@v3 - - - name: Publish package distributions to PyPI - run: pdm publish diff --git a/.gitignore b/.gitignore deleted file mode 100755 index e5277435..00000000 --- a/.gitignore +++ /dev/null @@ -1,74 +0,0 @@ -.venv/ -.idea/ -.vscode/ -.cache/ - -venv/ - -node_modules/ -data/ -db/ -/resources/ -__pycache__/ -*.pyc -*.pyo -*.pyd -*.pyw -/plugins/ - -#config -/config/ -!config/default.yml -_config.yml -config.yml -config.example.yml - -# vuepress - -# mupy -mypy.ini - -# nuitka -compile.bat -src/resources/templates/latest-debug.html -main.build/ -main.dist/ -main.exe -main.cmd -docs/.vuepress/.cache/ -docs/.vuepress/.temp/ -docs/.vuepress/dist/ -prompt.txt - -# js -**/echarts.js -.env - - -# pdm -.pdm-python -.pdm-build -dist - -doc - -mkdoc2.py -result.json - -# litedoc -docs/zh/dev/api -docs/en/dev/api -mkdoc.bat - -# vitepress -docs/.vitepress/dist/ -docs/.vitepress/cache -docs/.vitepress/.temp - -# python toolchain -.mypy_cache/ -.pytest_cache/ - -# pdm -__pypackages__/ -pdm.lock \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100755 index a004f6bc..00000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,26 +0,0 @@ -fail_fast: true -repos: - - repo: https://github.com/psf/black - rev: 24.4.2 - hooks: - - id: black - args: [--config=./pyproject.toml] - - - repo: https://github.com/timothycrosley/isort - rev: 5.13.2 - hooks: - - id: isort - args: ["--profile", "black"] - - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 - hooks: - - id: mypy - - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - - id: check-added-large-files diff --git a/Dockerfile b/Dockerfile deleted file mode 100755 index ff02eda8..00000000 --- a/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/python:3.10-slim-bullseye - -ENV TZ Asia/Shanghai - -RUN apt-get update && apt-get install -y git - -WORKDIR /liteyukibot - -COPY . /liteyukibot - -RUN pip install --no-cache-dir -r requirements.txt - -RUN apt-get install -y libnss3 libnspr4 libdbus-1-3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libatspi2.0-0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libxkbcommon0 libasound2 libpango-1.0-0 libcairo2 - -EXPOSE 20216 - -CMD ["python", "main.py"] \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100755 index a5d47ab5..00000000 --- a/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -LSO license -LiteyukiStudio Opensource license - ---- - -版权所有 © 2024 Snowykami - ---- - -免费向任何获得副本的人或组织授予以相同许可为基础的权利 - -包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或出售软件的副本 - -本软件及相关文档文件(以下简称"本软件")在相同方式许可为基础, 以开源的形式发布于互联网抑或其他媒体介质平台 - -任何人都有权利获取副本并以上述方式获取许可传播和/或使用 - -但获取副本时仍需注意: - -- 上述版权声明和本许可声明应包含在本软件的副本中 - - 使用本软件及其副本时仍需保持与原有形式相同 - -- 在使用时仍需将本软件的副本以相同许可公开表现: - - 不得未经原作者允许将本软件的副本以非原许可的形式对外盈利 - ---- - -该软件按"原样"之副本提供,不提供任何形式的任意保证,明示或暗示: -包括但不限于适销性保证, 适用于特定目的非侵权 - -在任何情况下, 作者或版权所有者对任何非因作者或版权所有者使用该软件造成的索赔、损害或其他责任, 无论是在合同诉讼、侵权行为还是其他诉讼中都不具有责任, 作者及其版权所有者有权利驳回使用者因个人原因造成的任何损失之赔付 diff --git a/README.md b/README.md deleted file mode 100755 index a310e53e..00000000 --- a/README.md +++ /dev/null @@ -1,70 +0,0 @@ -
- -[//]: # (a) -[![][banner]][liteyuki-link] -

轻雪 6

-

✨ 轻量,高效,易于扩展✨

- -[![][Liteyuki6.0]][liteyuki-link] -[![][Python3.10+]][python-link] -[![][Usage]][usage-link] -[![][Repo]][repo-link] -[![][Github]][github-link] -[![][LiteyukiLab]][liteyukilab-link] -![docs uptime](https://uptime.liteyuki.icu/api/badge/8/uptime?labelPrefix=Docs+&style=for-the-badge) - -
- -## 关于 - -访问[轻雪6.0](https://bot.liteyuki.icu)主页获取更多信息 - -## 特点及优势 - -- 原生支持与任意`Python`Bot框架互联,有良好的生态支持 -- 开箱即用,无需复杂配置 -- 集成包管理器,支持一键安装插件 -- 自定义主题支持,满足审美需求 -- 国际化支持,支持多种语言 -- 高性能,500插件2s内启动 - -## 服务及支持(敬请期待) -- 提供Liteyuki Cloud官方的容器化托管服务,无需担心服务器问题 - -**👇所有内容请访问👇**: [bot.liteyuki.icu](https://bot.liteyuki.icu) - -## 参考及鸣谢 -- [nonebot-plugin-uninfo](https://github.com/RF-Tar-Railt/nonebot-plugin-uninfo)为会话部分用户信息提供了参考 -- [nonebot-plugin-alconna](https://github.com/nonebot/plugin-alconna/)为消息部分提供了参考 - -## 其他 -- 本仓库是一个monorepo,包含了框架,文档,测试,内置资源包,内置插件,预设配置等 - - -[Liteyuki6.0]: https://img.shields.io/badge/Liteyuki-6.0-blue?style=for-the-badge - -[Python3.10+]: https://img.shields.io/badge/Python-3.10+-blue?style=for-the-badge - -[Usage]: https://img.shields.io/badge/主页-文档-blue?style=for-the-badge - -[Repo]: https://img.shields.io/badge/官方托管-仓库-blue?style=for-the-badge - -[Github]: https://img.shields.io/badge/Github-仓库-blue?style=for-the-badge - -[LiteyukiLab]: https://img.shields.io/badge/轻雪社区-官方-blue?style=for-the-badge - - - -[python-link]:https://www.python.org/ - -[usage-link]:https://bot.liteyuki.icu/ - -[liteyuki-link]:https://bot.liteyuki.icu/ - -[repo-link]:https://git.liteyuki.icu/bot/app - -[github-link]:https://github.com/LiteyukiStudio/LiteyukiBot - -[liteyukilab-link]:https://lab.liteyuki.icu/@LiteyukiBot - -[banner]: https://socialify.git.ci/LiteyukiStudio/LiteyukiBot/image?description=1&forks=1&issues=1&Plus&pulls=1&stargazers=1&theme=Auto&logo=https%3a%2f%2fcdn.liteyuki.icu%2fstatic%2fsvg%2flylogo-full.svg diff --git a/config/default.yml b/config/default.yml deleted file mode 100755 index e278f19a..00000000 --- a/config/default.yml +++ /dev/null @@ -1,10 +0,0 @@ -nonebot: - host: 0.0.0.0 - port: 20216 - command_start: ["", "/"] - nickname: [ "liteyuki" ] - default_language: zh - driver: ~fastapi+~httpx+~websockets - alconna_use_command_start: true - gotify_token: "empty token" - diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100755 index 5b419786..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: '3.8' - -services: - app: - image: git.liteyuki.icu/bot/app:latest - ports: - - "20216:20216" - environment: - - TZ=Asia/Chongqing - volumes: - - .:/liteyukibot - command: [ "python", "main.py" ] diff --git a/docker/sources.list b/docker/sources.list deleted file mode 100755 index e0d1a18a..00000000 --- a/docker/sources.list +++ /dev/null @@ -1,10 +0,0 @@ -deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free -# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free -deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free -# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free - -deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free -# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free - -deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free -# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free \ No newline at end of file diff --git a/docs/.vitepress/config/common.ts b/docs/.vitepress/config/common.ts deleted file mode 100755 index f4900cba..00000000 --- a/docs/.vitepress/config/common.ts +++ /dev/null @@ -1,138 +0,0 @@ -// 共有配置项,导入index用 - -import { defineConfig } from "vitepress"; -import { generateSidebar } from "vitepress-sidebar"; -import { zh } from "./zh"; -import { en } from "./en"; - -let defaultLocale = "zh"; -const commonSidebarOptions = { - collapsed: true, - convertSameNameSubFileToGroupIndexPage: true, - useTitleFromFrontmatter: true, - useFolderTitleFromIndexFile: true, - useFolderLinkFromIndexFile: true, - includeFolderIndexFile: true, - sortMenusByFrontmatterOrder: true, - rootGroupText: "LITEYUKIBOT", -}; - -/** - * Generate sidebar config - * multiple languages and sections - * @returns {any[]} - */ -function generateSidebarConfig(): any[] { - let sections = ["dev", "store", "usage", "deploy"]; - let languages = ["zh", "en"]; - let ret = []; - for (let language of languages) { - for (let section of sections) { - if (language === defaultLocale) { - ret.push({ - basePath: `/${section}/`, - scanStartPath: `${language}/${section}`, - resolvePath: `/${section}/`, - ...commonSidebarOptions, - }); - } else { - ret.push({ - basePath: `/${language}/${section}/`, - scanStartPath: `${language}/${section}`, - resolvePath: `/${language}/${section}/`, - ...commonSidebarOptions, - }); - } - } - } - return ret; -} - -export const common = defineConfig({ - head: [ - // 配置favicon.ico - ["link", { rel: "icon", type: "image/x-icon", href: "favicon.ico" }], - [ - "link", - { - rel: "stylesheet", - href: "https://fonts.font.im/css?family=Cousine:400,400i,700,700i|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i", - }, - ], - ["script", { src: "https://cdn.liteyuki.icu/js/liteyuki_footer.js" }], - ], - rewrites: { - [`${defaultLocale}/:rest*`]: ":rest*", - }, - cleanUrls: false, - themeConfig: { - logo: { - light: "/liteyuki.svg", - dark: "/liteyuki-dark.svg", - alt: "LiteyukiBot Logo", - }, - sidebar: generateSidebar([...generateSidebarConfig()]), - socialLinks: [ - { icon: "github", link: "https://github.com/LiteyukiStudio/LiteyukiBot" }, - { - icon: { - svg: '', - }, - link: "https://git.liteyuki.icu/bot/app", - }, - { - icon: { - svg: '', - }, - link: "https://lab.liteyuki.icu/@LiteyukiBot", - }, - ], - search: { - provider: "local", - options: { - locales: { - root: { - translations: { - button: { - buttonText: "搜索文档", - buttonAriaLabel: "打开搜索框", - }, - modal: { - noResultsText: "没有找到搜索结果", - resetButtonTitle: "清除查询条件", - footer: { - selectText: "选择", - navigateText: "切换", - }, - }, - }, - }, - en: { - translations: { - button: { - buttonText: "Search", - buttonAriaLabel: "Search", - }, - modal: { - noResultsText: "No results found", - resetButtonTitle: "Reset search query", - footer: { - selectText: "Select", - navigateText: "Navigate", - }, - }, - }, - }, - }, - }, - }, - }, - sitemap: { - hostname: "https://bot.liteyuki.icu", - }, - lastUpdated: true, - locales: { - root: { label: "简体中文", ...zh }, - en: { label: "English", ...en }, - }, -}); diff --git a/docs/.vitepress/config/en.ts b/docs/.vitepress/config/en.ts deleted file mode 100755 index 4de548ea..00000000 --- a/docs/.vitepress/config/en.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {defineConfig} from 'vitepress' -import {ThemeConfig} from "./utils"; - -export const en = defineConfig({ - lang: "en-US", - title: "LiteyukiBot", - description: "A high-performance, easy-to-use chatbot framework and application", - themeConfig: { - nav: [ - {text: 'Deploy', link: '/en/deploy/install'}, - {text: 'Usage', link: '/en/usage/basic'}, - {text: 'Extension', link: '/en/store/resource'}, - {text: 'Develop', link: '/en/dev/guide'}, - ], - docFooter: { - prev: 'Prev Page', - next: 'Next Page' - }, - editLink: ThemeConfig.getEditLink( - 'Edit this page on GitHub', - ), - footer: { - message: 'Page is deployed at Liteyuki Meli and accelerated by Liteyukiflare
Documentation built with VitePress | API references generated by litedoc', - copyright: ThemeConfig.copyright - }, - outline: ThemeConfig.getOutLine("Page Content"), - - langMenuLabel: 'Language', - returnToTopLabel: 'Back to top', - sidebarMenuLabel: 'Menu', - darkModeSwitchLabel: 'Theme', - lightModeSwitchTitle: 'Light Mode', - darkModeSwitchTitle: 'Dark Mode', - }, -}) \ No newline at end of file diff --git a/docs/.vitepress/config/index.ts b/docs/.vitepress/config/index.ts deleted file mode 100755 index f79dc256..00000000 --- a/docs/.vitepress/config/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -import {defineConfig} from "vitepress"; - -import {common} from './common' -export default defineConfig({ - ...common, -}) \ No newline at end of file diff --git a/docs/.vitepress/config/utils.ts b/docs/.vitepress/config/utils.ts deleted file mode 100755 index 8f2b8fc7..00000000 --- a/docs/.vitepress/config/utils.ts +++ /dev/null @@ -1,40 +0,0 @@ -// 本模块储存一些工具函数和引用 - -/** - * GetEditLink Options - * @param text Edit link text - */ -export const ThemeConfig = { - getEditLink: (editPageText: string): { pattern: (params: { filePath: string; }) => string; text: string; } => { - return { - pattern: ({filePath}: { filePath: string; }): string => { - // 匹配 /dev/api或 /{lang}/dev/api - const regex = /^[^\/]+\/dev\/api/; - console.log(filePath); - if (regex.test(filePath)) { - // remove {lang}/api prefix - filePath = filePath.replace(regex, '') - .replace('index.md', '__init__.py') - .replace('.md', '.py'); - // 若文件名(不含扩展)和上级文件夹相同,返回文件夹/__init__.py - if (filePath.split('/').pop().split('.')[0] === filePath.split('/').slice(-2, -1)[0]) { - filePath = filePath.split('/').slice(0, -1).join('/') + '/__init__.py'; - } - return `https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki${filePath}`; - } else { - return `https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/docs/${filePath}`; - } - }, - text: editPageText - }; - }, - - getOutLine: (label: string): { label: string; level: [number, number]; } => { - return { - label: label, - level: [2, 6] - }; - }, - - copyright: 'Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved' -} diff --git a/docs/.vitepress/config/zh.ts b/docs/.vitepress/config/zh.ts deleted file mode 100755 index 43392725..00000000 --- a/docs/.vitepress/config/zh.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {defineConfig} from 'vitepress' -import {ThemeConfig} from "./utils"; - -export const zh = defineConfig({ - lang: "zh-Hans", - title: "轻雪机器人", - description: "一个综合性的机器人应用及管理框架", - themeConfig: { - nav: [ - {text: '部署', link: '/deploy/install'}, - {text: '使用', link: '/usage/basic'}, - {text: '扩展', link: '/store/resource'}, - {text: '开发', link: '/dev/guide'}, - ], - docFooter: { - prev: '上一页', - next: '下一页' - }, - editLink: ThemeConfig.getEditLink( - '在 GitHub 上编辑此页', - ), - footer: { - message: '网站部署在 Liteyuki MeliLiteyukiflare 提供加速服务
文档由 VitePress 构建 | API引用由 litedoc 生成', - copyright: ThemeConfig.copyright - }, - outline: ThemeConfig.getOutLine("页面内容"), - - langMenuLabel: '语言', - returnToTopLabel: '返回顶部', - sidebarMenuLabel: '菜单', - darkModeSwitchLabel: '主题', - lightModeSwitchTitle: '轻色模式', - darkModeSwitchTitle: '深色模式', - }, -}) \ No newline at end of file diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts deleted file mode 100755 index eda6ca3d..00000000 --- a/docs/.vitepress/theme/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -import DefaultTheme from 'vitepress/theme' -import './liteyuki.scss' - -import StatsBar from '../../components/StatsBar.vue' -import PluginStore from '../../components/PluginStore.vue' -import ResStore from '../../components/ResStore.vue' - - - -export default { - extends: DefaultTheme, - enhanceApp({ app }) { - app.component('StatsBar', StatsBar); - app.component('PluginStore', PluginStore); - app.component('ResStore', ResStore); - }, - Layout: StatsBar -} \ No newline at end of file diff --git a/docs/.vitepress/theme/liteyuki.scss b/docs/.vitepress/theme/liteyuki.scss deleted file mode 100755 index 3c4065f3..00000000 --- a/docs/.vitepress/theme/liteyuki.scss +++ /dev/null @@ -1,149 +0,0 @@ -:root { - --vp-c-brand-1: #149ef8; - --vp-c-brand-2: #0434ad; - --vp-home-hero-name-color: transparent; - --vp-home-hero-name-background: -webkit-linear-gradient(120deg, #34a3fe 30%, #8d44ff); - - --vp-home-hero-image-background-image: linear-gradient(-45deg, #d0e9ff 50%, #a2d8f4 50%); - --vp-home-hero-image-filter: blur(44px); - - --vp-c-gray-1: #eee; - --vp-c-gray-2: #aaa; - --border-radius-1: 10px; - --border-radius-2: 20px; - --border-radius-3: 40px; - --vp-font-family-base: 'Poppins', 'Punctuation SC', 'Inter', ui-sans-serif, system-ui, - 'PingFang SC', 'Noto Sans CJK SC', 'Noto Sans SC', 'Heiti SC', - 'Microsoft YaHei', 'DengXian', sans-serif, 'Apple Color Emoji', - 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; - --vp-font-family-mono: 'Cousine', monospace; - - --red: #ef4444; - --liteyuki-color: #149ef8; - --button-radius: 6px; - - -} - -.dark { - --vp-home-hero-image-background-image: linear-gradient(-45deg, #004785 50%, #0374ad 50%); - --vp-c-gray-1: #333; - --vp-c-gray-2: #666; -} - -.tab-buttons { - padding: 7px; - flex: 1; - display: flex; - justify-content: flex-start; - height: 60%; - align-items: center; -} - - -.tab-title { - text-align: center; - justify-content: center; - flex: 1; -} - -.item-search-box { - border-radius: 100px; - width: 80%; - padding: 10px; - margin: 10px 0; - border: 1px solid #ccc; -} - -.search-box-div { - display: flex; - justify-content: space-around; - margin: 10px 0; -} - -.item-search-box { - width: 80%; -} - -.item-card { - position: relative; - border-radius: 15px; - background-color: var(--vp-c-gray-1); - height: 160px; - padding: 16px; - margin: 10px; - box-sizing: border-box; - transition: background 0.3s ease; -} - -.item-name { - font-size: 20px; - margin-bottom: 10px; -} - -.item-description { - color: var(--vp-c-gray-2); - font-size: 13px; - white-space: pre-wrap; -} - -.author-info { - display: flex; - justify-content: left; - align-items: center; -} - -.author-name { - font-size: 15px; - font-weight: normal; -} - -.avatar { - border-radius: 50%; - margin: 0 10px; -} - - -/*store*/ - -.store-tabs { - display: flex; - justify-content: flex-end; - margin: 10px 0; -} - -.publish-button { - right: 10px; - bottom: 10px; - padding: 5px 10px; - border-radius: 10px; - background-color: var(--vp-c-brand-1); - color: white; - font-size: 15px; - cursor: pointer; -} - -.pub-window { - input { - width: 100%; - padding: 10px; - margin: 10px 0; - border-radius: 10px; - border: 1px solid #ccc; - } -} - -.pub-option { - margin: 10px; - padding: 5px; - border: 2px solid var(--vp-c-gray-1); - border-radius: var(--button-radius); - background-color: var(--vp-c-gray-1); - - &.close { - } - - &.submit { - background-color: var(--vp-c-brand-1); - } -} diff --git a/docs/components/ContributorBar.vue b/docs/components/ContributorBar.vue deleted file mode 100755 index 377bbc46..00000000 --- a/docs/components/ContributorBar.vue +++ /dev/null @@ -1,26 +0,0 @@ - - - - - \ No newline at end of file diff --git a/docs/components/Dash.vue b/docs/components/Dash.vue deleted file mode 100755 index f1c752af..00000000 --- a/docs/components/Dash.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - \ No newline at end of file diff --git a/docs/components/Geo.vue b/docs/components/Geo.vue deleted file mode 100755 index 0e394ac8..00000000 --- a/docs/components/Geo.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - - \ No newline at end of file diff --git a/docs/components/Home.vue b/docs/components/Home.vue deleted file mode 100755 index 5baeb6aa..00000000 --- a/docs/components/Home.vue +++ /dev/null @@ -1,10 +0,0 @@ - - - - - \ No newline at end of file diff --git a/docs/components/PluginItemCard.vue b/docs/components/PluginItemCard.vue deleted file mode 100755 index 938412aa..00000000 --- a/docs/components/PluginItemCard.vue +++ /dev/null @@ -1,109 +0,0 @@ - - - - - \ No newline at end of file diff --git a/docs/components/PluginStore.vue b/docs/components/PluginStore.vue deleted file mode 100755 index 170d788a..00000000 --- a/docs/components/PluginStore.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - - - \ No newline at end of file diff --git a/docs/components/ResItemCard.vue b/docs/components/ResItemCard.vue deleted file mode 100755 index 65e5a0f6..00000000 --- a/docs/components/ResItemCard.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - - - \ No newline at end of file diff --git a/docs/components/ResPubWindow.vue b/docs/components/ResPubWindow.vue deleted file mode 100755 index 84e40139..00000000 --- a/docs/components/ResPubWindow.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - \ No newline at end of file diff --git a/docs/components/ResStore.vue b/docs/components/ResStore.vue deleted file mode 100755 index 3b8d7d75..00000000 --- a/docs/components/ResStore.vue +++ /dev/null @@ -1,105 +0,0 @@ - - - - - \ No newline at end of file diff --git a/docs/components/StatsBar.vue b/docs/components/StatsBar.vue deleted file mode 100755 index f6c356c6..00000000 --- a/docs/components/StatsBar.vue +++ /dev/null @@ -1,301 +0,0 @@ - - - - - \ No newline at end of file diff --git a/docs/components/Tabs.vue b/docs/components/Tabs.vue deleted file mode 100755 index e69de29b..00000000 diff --git a/docs/components/ToggleSwitch.vue b/docs/components/ToggleSwitch.vue deleted file mode 100755 index 9f6088e9..00000000 --- a/docs/components/ToggleSwitch.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - - \ No newline at end of file diff --git a/docs/components/TryLiteyukiWindow.vue b/docs/components/TryLiteyukiWindow.vue deleted file mode 100755 index 96c0baf2..00000000 --- a/docs/components/TryLiteyukiWindow.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - - - \ No newline at end of file diff --git a/docs/components/scripts/const.ts b/docs/components/scripts/const.ts deleted file mode 100755 index 77a05f3d..00000000 --- a/docs/components/scripts/const.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const platformBaseURL = "https://github.com/" -export const repoPath = "LiteyukiStudio/LiteyukiBot" - -export const repoURL = `${platformBaseURL}${repoPath}` \ No newline at end of file diff --git a/docs/components/scripts/i18n.ts b/docs/components/scripts/i18n.ts deleted file mode 100755 index 86319111..00000000 --- a/docs/components/scripts/i18n.ts +++ /dev/null @@ -1,112 +0,0 @@ -import {ref} from "vue"; - -import {useData} from "vitepress"; - -const i18nData = { - en: { - stats: 'Stats', - online: 'Online', - offline: 'Offline', - total: 'Total', - fetching: 'Fetching', - stars: 'Stars', - forks: 'Forks', - issues: 'Issues', - prs: 'Pull Requests', - visitors: 'Visitors', - size: 'Size', - plugins: 'Plugins', - resources: 'Resources', - pluginStore: 'Plugin Store', - pluginStoreDesc: 'Content from the LightSnow Plugin Store, LightSnow supports NoneBot through the lpnonebot plugin, and references some NoneBot plugins', - liteyukiOnly: 'Liteyuki Only', - search: 'Search', - resourceStore: 'Resources Store', - thx_contributors: 'Thanks the following contributors!', - easterEgg: 'Congratulations on finding the Easter egg!', - - publishPlugin: 'Publish Plugin', - publishRes: 'Publish Resource', - closeButtonText: 'Close', - submitButtonText: 'Submit', - - resName: 'Name', - resDesc: 'Description', - resAuthor: 'Author', - resLink: 'Download Link', - resHomepage: 'Homepage', - - resNameText: 'Example: Kawaii Style Theme', - resDescText: 'Example: A kawaii style and color theme', - resAuthorText: 'Usually the github username, Example: yanyongyu', - resLinkText: 'Direct download link, usually zip package link', - resHomepageText: 'Optional, can be the name of the git platform repository"', - }, - zh: { - stats: '统计信息', - online: '在线', - offline: '离线', - total: '实例', - fetching: '获取中', - stars: '星星', - forks: '分叉', - issues: '议题', - prs: '拉取请求', - visitors: '访客', - size: '大小', - plugins: '插件', - resources: '主题资源', - store: '商店', - pluginStore: '插件商店', - pluginStoreDesc: '内容来自轻雪插件商店,轻雪通过lpnonebot插件对NoneBot实现支持,引用了部分NoneBot插件', - liteyukiOnly: '仅轻雪', - search: '搜索', - resourceStore: '资源商店', - thx_contributors: '感谢以下贡献者!', - easterEgg: '恭喜你发现了彩蛋!', - - publishPlugin: '发布插件', - publishRes: '发布资源', - closeButtonText: '关闭', - submitButtonText: '提交', - - resName: '名称', - resDesc: '描述', - resAuthor: '作者', - resLink: '下载链接', - resHomepage: '主页', - - resNameText: '示例:可爱风格主题', - resDescText: '示例:一个可爱风格和配色的主题', - resAuthorText: '通常为github用户名,示例:yanyongyu', - resLinkText: '直接下载链接,通常为zip包链接', - resHomepageText: '可选,可为git平台仓库名', - } -} - -let refData = {} - -function getText(lang: string, key: string): string { - lang = formatLang(lang); - return i18nData[lang][key]; -} - -export function formatLang(lang: string): string { - if (lang.includes('-')) { - return lang.split('-')[0]; - } - return lang; -} - -export function updateRefData() { - const lang = formatLang(useData().site.value.lang); - for (let key in refData) { - refData[key].value = getText(lang, key); - } -} - -export function getTextRef(key: string): any { - const lang = formatLang(useData().site.value.lang); - refData[key] = getText(lang, key); - return refData[key] || key; -} diff --git a/docs/components/scripts/statsApi.ts b/docs/components/scripts/statsApi.ts deleted file mode 100755 index aedf1f99..00000000 --- a/docs/components/scripts/statsApi.ts +++ /dev/null @@ -1,182 +0,0 @@ -// URL -export const OWNER = "LiteyukiStudio" -export const REPO = "LiteyukiBot" -const githubAPIUrl = "https://api.github.com" -const giteaAPIUrl = "https://git.liteyuki.icu/api/v1" -const onlineFetchUrl = "https://api.liteyuki.icu/online"; -const totalFetchUrl = "https://api.liteyuki.icu/count"; -const visitRecordUrl = "https://api.liteyuki.icu/visit"; -const visitCountUrl = "https://api.liteyuki.icu/visit_count"; - -export const RepoUrl = `https://github.com/${OWNER}/${REPO}` -export const StarMapUrl = "https://starmap.liteyuki.icu" - -type GithubStats = { - stars: number; - forks: number; - watchers: number; - issues?: number; - prs?: number; - size?: number; -} - -// 异步接口 -interface StatsApi { - getTotal: () => Promise; - getOnline: () => Promise; - getGithubStats: () => Promise; - getPluginNum: () => Promise; - getResourceNum: () => Promise; - getVisitCount: () => Promise; -} - - -export type {GithubStats}; - -async function getGiteaStats() { - try { - const url = `${giteaAPIUrl}/repos/${OWNER}/${REPO}`; - console.log(url); - const res = await fetch(url); - const data = await res.json(); - return { - stars: data.stars_count, - forks: data.forks_count, - watchers: data.watchers_count, - issues: 0, - prs: 0, - size: data.size, - }; - } catch (e) { - return { - stars: -1, - forks: -1, - watchers: -1, - issues: -1, - prs: -1, - size: -1, - }; - } -} - -async function getGithubStats() { - try { - const res = await fetch(`${githubAPIUrl}/repos/${OWNER}/${REPO}`); - const data = await res.json(); - return { - stars: data.stargazers_count, - forks: data.forks_count, - watchers: data.watchers_count, - issues: data.open_issues_count, - prs: data.open_issues_count, - size: data.size, - }; - } catch (e) { - return { - stars: -1, - forks: -1, - watchers: -1, - issues: -1, - prs: -1, - size: -1, - }; - } -} - -async function getRepoStats() { - // 两个接口各数据,加和返回 - const githubStats = await getGithubStats(); - const giteaStats = await getGiteaStats(); - return { - stars: githubStats.stars + giteaStats.stars, - forks: githubStats.forks + giteaStats.forks, - watchers: githubStats.watchers + giteaStats.watchers, - issues: githubStats.issues + giteaStats.issues, - prs: githubStats.prs + giteaStats.prs, - size: githubStats.size + giteaStats.size, - }; -} - -// 实现接口 -export const statsApi: StatsApi = { - getTotal: async () => { - try { - const res = await fetch(totalFetchUrl); - const data = await res.json(); - return data.register; - } catch (e) { - return -1; - } - }, - getOnline: async () => { - try { - const res = await fetch(onlineFetchUrl); - const data = await res.json(); - return data.online; - } catch (e) { - return -1; - } - }, - getGithubStats: getRepoStats, - getPluginNum: async () => { - try { - const res = await fetch('/plugins.json'); - const data = await res.json(); - return data.length; - } catch (e) { - return -1; - } - }, - getResourceNum: async () => { - try { - const res = await fetch('/resources.json'); - const data = await res.json(); - return data.length; - } catch (e) { - return -1; - } - }, - getVisitCount: async () => { - try { - const res = await fetch(visitCountUrl); - const data = await res.json(); - return data.count; - } catch (e) { - return -1; - } - } -}; - -function getDeviceId(): string { - // 用户每次访问时生成一个唯一的设备ID,储存在localStorage中,用于统计用户数量 - const deviceIdKey = 'deviceId'; - let deviceId = localStorage.getItem(deviceIdKey); - - if (!deviceId) { - deviceId = generateUUID(); - localStorage.setItem(deviceIdKey, deviceId); - } - return deviceId; -} - -export async function uploadVisitRecord() { - const deviceId = getDeviceId(); - try { - await fetch(visitRecordUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: new URLSearchParams({'device_id': deviceId}).toString(), - }); - } catch (e) { - console.error('Failed to upload visit record:', e); - } -} - -function generateUUID(): string { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - var r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3 | 0x8); - return v.toString(16); - }); -} \ No newline at end of file diff --git a/docs/en/deploy/config.md b/docs/en/deploy/config.md deleted file mode 100755 index cbe7cc48..00000000 --- a/docs/en/deploy/config.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: Configurations -order: 2 ---- - -# Configurations - -LiteyukiBot supports `yaml`, `json`, and `toml` as configuration files, depending on your personal preference. - -When you first run LiteyukiBot, it will generate `config.yml` and the `config` directory. You can modify the configuration items and restart LiteyukiBot. In most cases, you only need to modify -the `superusers` and `nickname` fields. - -When starting, LiteyukiBot will load all configuration files in the project directory `config.yml/yaml/json/toml` and the `config` directory. You can create multiple configuration files in -the `config` directory, and LiteyukiBot will automatically merge these configuration files. - -## **Basic Configuration** - -```yaml -# NoneBot configuration -nonebot: - command_start: [ "/", "" ] # Command prefix, if there is no "" empty command header, please enable alconna_use_command_start to ensure alconna parsing is normal - host: 127.0.0.1 # Listening address, default is local, if you want to receive external requests, please fill in - port: 20216 # Binding port - nickname: [ "liteyuki" ] # Bot nickname list - superusers: [ "1919810" ] # Superuser list -liteyuki: - log_level: "INFO" # Log level - log_icon: true # Whether to display the log level icon (some console fonts are not available) - auto_report: true # Whether to automatically report problems to Liteyuki server - auto_update: true # Whether to automatically update Liteyuki, check for updates at 4 am every day - plugins: [ ] # Liteyuki plugin list - plugin_dirs: [ ] # Liteyuki plugin directory list -``` - -## **Other configurations** - -The following is the default value. If you need to customize it, please add it manually - -```yaml -# Advanced configuration -nonebot: - onebot_access_token: "" # OneBot access token - default_language: "zh-CN" # Default language - alconna_auto_completion: false # alconna auto completion - safe_mode: false # Safe mode, if true, the bot will not load any plugins - # other nonebot configurations - custom_config_1: "custom_value1" - custom_config_2: "custom_value2" - -# development configuration -liteyuki: - allow_update: true # Whether to allow Liteyuki to update - debug: false # Debug mode, if true, Liteyuki will output more detailed logs - dev_mode: false # development mode, if true, Liteyuki will load all plugins in the development directory -... -``` - -```yaml - -``` - -## **Example: Configuration of OneBot implementation side connected to NoneBot** - -In production environments, it is recommended to use reverse WebSocket -The fields provided by different implementation sides may be different, but basically the same. Here is a reference value - -| Fields | Value | Description | -|-------------|------------------------------------|---------------------------------------------------------------------------------------| -| protocol | Reverse WebSocket | Liteyuki-NoneBot as server | -| address | ws://127.0.0.1:20216/onebot/v11/ws | The address depends on the configuration file, the default is ` | -| AccessToken | `""` | If you have configured `AccessToken` for Liteyuki, please fill in the same value here | - -- To use other communication methods, please visit [OneBot Adapter](https://onebot.adapters.nonebot.dev/) for detailed information - -## **Other** - -- Liteyuki is not limited to the OneBot adapter and NoneBot2. You can use any adapter supported by NoneBot2 or use the Liteyuki message delivery plugin diff --git a/docs/en/deploy/fandq.md b/docs/en/deploy/fandq.md deleted file mode 100755 index c5290a1f..00000000 --- a/docs/en/deploy/fandq.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: FAQ -order: 3 ---- -# FAQ - -## **Frequently Asked Questions** - -- There are too many python interpreters on my computer, how do I know which one to use? - - You can specify which python interpreter to use by using the full path to the python executable, for example, `/path/to/python main.py` - - Use virtual environments to avoid conflicts between different python interpreters - -- Update Liteyuki failed, error `InvalidGitRepositoryError` - - Please install `Git` correctly and deploy Liteyuki using cloning instead of direct download - -- How to log in to chat platforms? - - Some plugins provide the ability to log in to specific platforms, for example, using the NoneBot plugin to log in to supported adapter platforms - -- `Playwright` installation failed - - Enter `playwright install` to install the browser - -- Some plugins report errors after installation and cannot be started - - Please refer to the plugin documentation first, confirm that the necessary configuration items of the plugin are intact, - and if the problem persists, please contact the plugin author or start Liteyuki in safe mode `safe_mode: true`. - In safe mode, you can use `npm uninstall` to uninstall problematic plugins - -## Other questions - -- Join chat group[775840726](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=SzmDYbfR6jY94o9KFNon7AwelRyI6M_u&authKey=ygeBdEmdFNyCWuNR4w0M1M8%2B5oDg7k%2FDfN0tzBkYcnbB%2FGHNnlVEnCIGbdftsnn7&noverify=0&group_code=775840726) -- If you don't have a QQ account, you can [submit an issue on GitHub](https://github.com/LiteyukiStudio/LiteyukiBot/issues/new?assignees=&labels=&projects=&template=%E9%97%AE%E9%A2%98%E5%8F%8D%E9%A6%88.md&title=) diff --git a/docs/en/deploy/install.md b/docs/en/deploy/install.md deleted file mode 100755 index 6b9ee5b3..00000000 --- a/docs/en/deploy/install.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: Install -order: 1 ---- -# Install - -## **Normal Installation** - -1. Install [`Git`](https://git-scm.com/download/) and [`Python3.10+`](https://www.python.org/downloads/release/python-31010/) Environment. - -```bash -# Clone Repo -git clone https://github.com/LiteyukiStudio/LiteyukiBot --depth=1 - -# Change directory -cd LiteyukiBot - -# Create virtual environment -python -m venv venv - -# Activate virtual environment -.\venv\Scripts\activate # Windows -source venv/bin/activate # Linux - -# Install dependencies -pip install -r requirements.txt - -# Run Liteyuki -python main.py -``` - -> [!tip] -> It is recommended to use a virtual environment to run Liteyuki to avoid dependency conflicts. -> You can use `python -m venv .venv` to create a virtual environment, and then use `.venv\Scripts\activate` to activate the virtual environment -> (use `source .venv/bin/activate` to activate on Linux). - - -## **Run with Docker** - -```bash -docker pull ghcr.io/liteyukistudio/liteyukibot:latest # Nightly build -``` - -> [!tip] -> If you are using Windows, please use the absolute project directory `/path/to/LiteyukiBot` instead of `$(pwd)`
-> If you have modified the port number, please replace `20216:20216` with your port number - - -## **Device Requirements** -- Windows system version minimum `Windows10+`/`Windows Server 2019+` -- Linux system requires Python3.10+, recommended `Ubuntu 20.04+` -- CPU: at least `1vCPU` -- Memory: Bot without other plugins will occupy `300~500MB`, including `chromium` and `node` processes, other plugins depend on specific plugins, recommended `1GB` or more -- Disk: at least `1GB` of space - -> [!warning] -> If there are multiple environments on the device, please use `path/to/python -m pip install -r requirements.txt` to install dependencies, `path/to/python` is the path to your Python executable - -> [!warning] -> Liteyuki's update function depends on Git. If you do not have Git installed and run the source code directly, you will not be able to use the update function - -#### For other questions, please refer to [FAQ](./fandq) \ No newline at end of file diff --git a/docs/en/dev/best_practices.md b/docs/en/dev/best_practices.md deleted file mode 100755 index 42f78ccc..00000000 --- a/docs/en/dev/best_practices.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: Best Practices -order: 10 ---- - -# Best Practices - -## Bot applications -- [LiteyukiBot](https://github.com/LiteyukiStudio/LiteyukiBot): Liteyuki Official Bot -- [LiteyukiBot-TriM](https://github.com/TriM-Organization/LiteyukiBot-TriM): TriM Official Custom Liteyuki Bot -- [Liteyuki Marsho](https://git.liteyuki.icu/LiteyukiStudio/marsho-alpha): A cute cat girl bot based on Liteyuki and the github model - -## plugins -- [liteyukibot-plugin-nonebot](https://github.com/LiteyukiStudio/liteyukibot-plugin-nonebot): Liteyuki Bot NoneBot plugin, allowing Liteyuki to support NoneBot -- [nonebot-plugin-liteyukibot](https://github.com/LiteyukiStudio/nonebot-plugin-liteyukibot): NoneBot plugin, allowing NoneBot to support Liteyuki - -## Others -- [liteyuki starmap](https://starmap.liteyuki.icu): Liteyuki official star map, showing all instances of Liteyuki and their location distribution -- [TRSS_Liteyuki](https://timerainstarsky.github.io/TRSS_Liteyuki/): LiteyukiBot management script -- [litedoc](https://github.com/LiteyukiStudio/litedoc): Liteyuki API documentation generator -- liteyukibot-api (closed source): Liteyuki Bot stat interface \ No newline at end of file diff --git a/docs/en/dev/comm.md b/docs/en/dev/comm.md deleted file mode 100755 index 3eac88ab..00000000 --- a/docs/en/dev/comm.md +++ /dev/null @@ -1,98 +0,0 @@ ---- -title: Process Communication -order: 4 ---- - -# **Channel Communication** - -### Introduction - -LiteyukiBot is running in the main process MainProcess, and other plugin framework processes are child processes that come with it. -Therefore, it is impossible to communicate through shared memory and direct object transfer. -Liteyuki provides a channel [`Channel`](./api/comm/channel#class-channel-generic-t) for inter-process communication like `go`. -You can send messages to other processes through [`Channel`](./api/comm/channel#class-channel-generic-t) and listen to messages from other processes. - -### Example - -The channel is full-duplex, with two receiving modes, but only one mode can be used for a channel, that is, passive mode and active mode, passive mode is implemented by the `chan.on_receive()` decorator callback function, and active mode needs to call `chan.receive()` to implement - -- 创建子进程的同时会初始化一个被动通道和一个主动通道,且通道标识为`{process_name}-active`和`{process_name}-passive`, -- 主进程中通过`get_channel`函数获取通道对象 -- 子进程中导入单例`active_channel`及`passive_channel`即可 - -> 在轻雪插件中(主进程中) - -```python -import asyncio - -from liteyuki.comm import get_channel, Channel -from liteyuki import get_bot - -# get_channel函数获取通道对象,参数为调用set_channel时的通道标识 -channel_passive = get_channel("nonebot-passive") # 获取被动通道 -channel_active = get_channel("nonebot-active") # 获取主动通道 -liteyuki_bot = get_bot() - - -# 注册一个函数在轻雪启动后运行 -@liteyuki_bot.on_after_start -async def send_data(): - while True: - channel_passive.send("I am liteyuki main process passive") - channel_active.send("I am liteyuki main process active") - await asyncio.sleep(3) # 每3秒发送一次消息 -``` - -> 在子进程中(例如NoneBot插件中) - -```python -from nonebot import get_driver -from liteyuki.comm import active_channel, passive_channel # 子进程中获取通道直接导入进程全局单例即可 -from liteyuki.log import logger - -driver = get_driver() - - -# 被动模式,通过装饰器注册一个函数在接收到消息时运行,每次接收到字符串数据时都会运行 -@passive_channel.on_receive(filter_func=lambda data: isinstance(data, str)) -async def on_passive_receive(data): - logger.info(f"Passive receive: {data}") - - -# 注册一个函数在NoneBot启动后运行 -@driver.on_startup -def on_startup(): - while True: - data = active_channel.receive() - logger.info(f"Active receive: {data}") -``` - -> 启动后控制台输出 - -```log -0000-00-00 00:00:00 [ℹ️信息] Passive receive: I am liteyuki main process passive -0000-00-00 00:00:00 [ℹ️信息] Active receive: I am liteyuki main process active -0000-00-00 00:00:03 [ℹ️信息] Passive receive: I am liteyuki main process passive -0000-00-00 00:00:03 [ℹ️信息] Active receive: I am liteyuki main process active -... -``` - -## **共享内存通信** - -### 简介 - -- 相比于普通进程通信,内存共享使得代码编写更加简洁,轻雪框架提供了一个内存共享通信的接口,你可以通过`storage`模块实现内存共享通信,该模块封装通道实现 -- 内存共享是线程安全的,你可以在多个线程中读写共享内存,线程锁会自动保护共享内存的读写操作 - -### 示例 - -> 在任意进程中均可使用 - -```python -from liteyuki.comm.storage import shared_memory - -shared_memory.set("key", "value") # 设置共享内存 -value = shared_memory.get("key") # 获取共享内存 -``` - -源代码:[liteyuki/comm/storage.py](https://github.com/LiteyukiStudio/LiteyukiBot/blob/main/liteyuki/comm/storage.py) diff --git a/docs/en/dev/guide.md b/docs/en/dev/guide.md deleted file mode 100755 index a34be320..00000000 --- a/docs/en/dev/guide.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: Development Guide -order: 0 ---- - - - - -# Development Guide - -## How to Develop -Please read the [Plugin Development](./plugin) and [API Reference](./api/) documents if you are developing a plugin. - -If you need to submit code to the Liteyuki repository, please read the following: -1. First [fork](https://github.com/LiteyukiStudio/LiteyukiBot/fork) a copy of the Liteyuki repository to your personal/organization account. -2. Develop in your repository. -3. Create a new branch in your repository and submit your code to this branch. -4. Create a Pull Request in your repository to merge your branch into the `main` branch of the Liteyuki repository. - -- Participation in development assumes that you are already familiar with the basic usage of the Python language and the Liteyuki framework. -- If you are developing documentation, please ensure that you are familiar with Markdown syntax and basic front-end knowledge. -- Contact the repository maintainer in case of conflicts. - -### Suggestions -- During development, you can use tools such as `mypy`, `flake8`, and `black` for code checking and formatting. -- Enable developer mode by setting `dev_mode: true` in `config.yml` to see more debugging information in the console. - -## Project Structure -- `main.py`: Bot entry file -- `liteyuki`: Framework directory (liteyukibot) -- `src`: Bot application source code directory - - `liteyuki_plugins`: Liteyuki plugin directory - - `nonebot_plugins`: Nonebot plugin directory - - `resources`: Built-in resource packs directory - - `utils`: Utility directory -- `tests`: Unit test directory -- `docs`: Documentation directory - - `en`: English documentation - - `zh`: Chinese documentation -- `docker`: Docker related content directory - -The `liteyuki` framework is included in the `LiteyukiBot` application, so this project is both the `LiteyukiBot` application repository and the `liteyuki` framework repository. - -The `src` directory is the application part, please develop business logic in this directory. `liteyuki_plugins` and `nonebot_plugins` directories are plugin directories, please develop plugins in these directories. - - -## Standardization -- Code should follow [`PEP8`](https://pep8.org/) and [`Google Python Style Guide`](https://google.github.io/styleguide/pyguide.html). -- In addition, code submitted to the Liteyuki repository should follow the following guidelines: - - Ensure that the code is runnable and harmless. - - Ensure that the type hints in the code are correct. - - Ensure that the comment style is [`Google Docstring`](https://google.github.io/styleguide/pyguide.html) or - [`Liteyuki Docstring`](https://github.com/LiteyukiStudio/litedoc?tab=readme-ov-file#liteyuki-docstring)(recommended) to ensure that Litedoc can parse and generate documentation correctly. - - Strings should be enclosed in double quotes `"` as much as possible, and single quotes `'` should be used when nesting strings. - - If there is a part for ordinary users, ensure that the documentation is complete (each language has corresponding documentation). -- commit message should follow the following guidelines: - - You should commit the code after completing a feature or fixing a bug, and not mix the code of multiple features or bugs together. - - We use gitmoji to mark the type of commit, such as `:sparkles:` for introducing new features, `:bug:` for fixing bugs, etc., please refer to [gitmoji](https://gitmoji.dev/) for details. - - The format of the commit message is ` [type:] `, such as `:sparkles: feat: add new field to event`, - where the type field is the type of commit, not much is required, but please fill in as much as possible; the message field is a brief description, in summary, what you did. - - There is no restriction on the language of the commit message, and bilingual use is possible if conditions permit. -- The documentation should follow [`Markdown`](https://www.markdownguide.org/) syntax and support vitepress-related content: - - Revise the documentation for each language when editing. - - Ensure that the links in the document are correct and do not lead to inaccessible links. - - Ensure that the **User Documentation** is easy to understand and the **Development Documentation** is detailed. - -## Finally -- This project is a non-profit open-source project, and we welcome anyone to participate in development. Your contributions will make Liteyuki better. - - - \ No newline at end of file diff --git a/docs/en/dev/lyfunc.md b/docs/en/dev/lyfunc.md deleted file mode 100755 index 0601c48c..00000000 --- a/docs/en/dev/lyfunc.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: Liteyuki Function -order: 2 ---- - -# **轻雪函数** - -轻雪函数 Liteyuki Function 是轻雪的一个功能,它允许你在轻雪中运行一些自定义的由数据驱动的命令,类似于Minecraft的mcfunction,属于资源包的一部分,但需单独起篇幅. - -### **函数文件** - -函数文件放在资源包的`functions`目录下,文件名以`.mcfunction` `.lyfunction` `.lyf`结尾,例如`test.mcfunction`,文件内容为一系列的命令,每行一个命令,支持单行注释`#`(编辑时的语法高亮可采取`shell`格式),例如: - -```shell -# 在发信器输出"hello world" -cmd echo hello world - -# 如果你想同时输出多行内容可以尝试换行符(Python格式) -cmd echo hello world\nLiteyuki bot -``` - -也支持句末注释,例如: -```shell -cmd echo hello world # 输出"hello world" -``` - -### **命令文档** - -```shell -var [var2=value2] ... # 定义变量 -cmd # 在设备上执行命令 -api [var=value...] # 调用Bot API -function # 调用函数,可递归 -sleep