Metadata-Version: 2.3
Name: nonebot-plugin-quark-autosave
Version: 0.1.9
Summary: 配合 quark-auto-save(https://github.com/Cp0204/quark-auto-save) 使用, 支持添加，删除，列出，运行任务
Author: fllesser
Author-email: fllesser <fllessive@gmail.com>
Requires-Dist: httpx>=0.27.0,<1.0.0
Requires-Dist: nonebot-plugin-alconna>=0.59.4,<1.0.0
Requires-Dist: nonebot2>=2.4.3,<3.0.0
Requires-Python: >=3.10
Project-URL: Repository, https://github.com/fllesser/nonebot-plugin-quark-autosave
Description-Content-Type: text/markdown

<div align="center">
    <a href="https://v2.nonebot.dev/store">
    <img src="https://raw.githubusercontent.com/fllesser/nonebot-plugin-template/refs/heads/resource/.docs/NoneBotPlugin.svg" width="310" alt="logo"></a>

## ✨ nonebot-plugin-quark-autosave ✨
[![](https://img.shields.io/github/license/fllesser/nonebot-plugin-quark-autosave.svg)](./LICENSE)
[![](https://img.shields.io/pypi/v/nonebot-plugin-quark-autosave.svg)](https://pypi.python.org/pypi/nonebot-plugin-quark-autosave)
[![](https://img.shields.io/badge/python-3.10|3.11|3.12|3.13-blue.svg)](https://www.python.org/downloads/release/python-3100/)
<br/>
[![](https://img.shields.io/badge/code%20style-ruff-black?style=flat-square&logo=ruff)](https://github.com/astral-sh/ruff)
[![](https://img.shields.io/badge/package%20manager-uv-black?style=flat-square&logo=uv)](https://github.com/astral-sh/uv)
[![](https://results.pre-commit.ci/badge/github/fllesser/nonebot-plugin-quark-autosave/master.svg)](https://results.pre-commit.ci/latest/github/fllesser/nonebot-plugin-quark-autosave/master)
[![](https://codecov.io/gh/fllesser/nonebot-plugin-quark-autosave/graph/badge.svg?token=55rXGtMLMx)](https://codecov.io/gh/fllesser/nonebot-plugin-quark-autosave)

</div>

## 📖 介绍

配合 [quark-auto-save](https://github.com/Cp0204/quark-auto-save) 使用, 快速添加 quark 自动转存任务

## 💿 安装

<details open>
<summary>使用 nb-cli 安装</summary>
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装

    nb plugin install nonebot-plugin-quark-autosave --upgrade
使用 **pypi** 源安装

    nb plugin install nonebot-plugin-quark-autosave --upgrade -i "https://pypi.org/simple"
使用**清华源**安装

    nb plugin install nonebot-plugin-quark-autosave --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"


</details>

<details>
<summary>使用包管理器安装</summary>
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令

<details open>
<summary>uv</summary>

    uv add nonebot-plugin-quark-autosave
安装仓库 master 分支

    uv add git+https://github.com/fllesser/nonebot-plugin-quark-autosave@master
</details>

<details>
<summary>pdm</summary>

    pdm add nonebot-plugin-quark-autosave
安装仓库 master 分支

    pdm add git+https://github.com/fllesser/nonebot-plugin-quark-autosave@master
</details>
<details>
<summary>poetry</summary>

    poetry add nonebot-plugin-quark-autosave
安装仓库 master 分支

    poetry add git+https://github.com/fllesser/nonebot-plugin-quark-autosave@master
</details>

打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入

    plugins = ["nonebot_plugin_quark_autosave"]

</details>

<details>
<summary>使用 nbr 安装(使用 uv 管理依赖可用)</summary>

[nbr](https://github.com/fllesser/nbr) 是一个基于 uv 的 nb-cli，可以方便地管理 nonebot2

    nbr plugin install nonebot-plugin-quark-autosave
使用 **pypi** 源安装

    nbr plugin install nonebot-plugin-quark-autosave -i "https://pypi.org/simple"
使用**清华源**安装

    nbr plugin install nonebot-plugin-quark-autosave -i "https://pypi.tuna.tsinghua.edu.cn/simple"

</details>


## ⚙️ 配置

在 nonebot2 项目的`.env`文件中添加下表中的必填配置

|    配置项     | 必填  |         默认值          |                       说明                       |
| :-----------: | :---: | :---------------------: | :----------------------------------------------: |
| qas_endpoint  |  否   | "http://127.0.0.1:5005" |              quark-auto-save 的地址              |
|   qas_token   |  是   |           无            | 从 quark-auto-save webui 系统配置下拉 API 处获取 |
| qas_path_base |  否   |     "夸克自动转存"      |               自动转存文件夹的名称               |

## 🎉 使用
### 指令表
|   指令   | 权限  | 需要@ | 范围  |                     说明                     |
| :------: | :---: | :---: | :---: | :------------------------------------------: |
|   qas    | 主人  |  否   | 私聊  |               添加自动转存任务               |
| qas.run  | 主人  |  否   | 私聊  |  运行自动转存任务(不指定索引则运行所有任务)  |
| qas.list | 主人  |  否   | 私聊  |             查看自动转存任务列表             |
| qas.del  | 主人  |  否   | 私聊  | 指定索引(从 qas.list 中获取)删除自动转存任务 |

## 🫙 容器
- TELEGRAM_BOT_TOKEN: 机器人 token 获取方式: [@BotFather](https://t.me/BotFather)
- SUPERUSER: 超级用户 ID 获取方式: [@userinfobot](https://t.me/userinfobot)

```sh
docker run -d \
  --name quark-bot \
  -e PORT=8080 \
  -e SUPERUSER=1234567890 \
  -e TELEGRAM_BOT_TOKEN=bot_token \
  -e QAS_ENDPOINT=http://debian:5005 \
  -e QAS_TOKEN=3237101899 \
  --restart unless-stopped \
  --network bridge \
  ghcr.io/fllesser/quarkbot:latest
```

单独使用

```yml
services:
    nonebot:
        image: ghcr.io/fllesser/quarkbot:latest
        container_name: quark-bot
        environment:
          PORT: 8080
          SUPERUSER: 1234567890           
          TELEGRAM_BOT_TOKEN: bot_token  
          QAS_ENDPOINT: http://quark-auto-save:5005
          QAS_TOKEN: 1234567890           # 前往 quark-auto-save webui 系统配置下拉 API 处获取
        restart: unless-stopped
        network_mode: bridge

```
quark-auto-save, smartstrm, emby-server, quarkbot 配套 compose.yml 前往 [compose.yml](https://github.com/fllesser/nonebot-plugin-quark-autosave/blob/master/compose.yml)