Metadata-Version: 2.1
Name: nonebot-plugin-gsmaterial
Version: 0.1.6
Summary: Genshin daily material plugin for NoneBot2
Home-page: https://github.com/monsterxcn/nonebot-plugin-gsmaterial
License: MIT
Keywords: nonebot,nonebot2,genshin,material
Author: monsterxcn
Author-email: monsterxcn@gmail.com
Requires-Python: >=3.7.3,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Dist: Pillow (>=9.2.0,<10.0.0)
Requires-Dist: httpx (>=0.20.0,<1.0.0)
Requires-Dist: nonebot-adapter-onebot (>=2.0.0b1)
Requires-Dist: nonebot-plugin-apscheduler (>=0.1.0)
Requires-Dist: nonebot2 (>=2.0.0a16)
Project-URL: Documentation, https://github.com/monsterxcn/nonebot-plugin-gsmaterial#readme
Description-Content-Type: text/markdown

<h1 align="center">NoneBot Plugin GsMaterial</h1></br>


<p align="center">🤖 用于展示原神游戏每日材料数据的 NoneBot2 插件</p></br>


<p align="center">
  <a href="https://github.com/monsterxcn/nonebot-plugin-gsmaterial/actions">
    <img src="https://img.shields.io/github/workflow/status/monsterxcn/nonebot-plugin-gsmaterial/Build%20distributions?style=flat-square" alt="actions">
  </a>
  <a href="https://raw.githubusercontent.com/monsterxcn/nonebot-plugin-gsmaterial/master/LICENSE">
    <img src="https://img.shields.io/github/license/monsterxcn/nonebot-plugin-gsmaterial?style=flat-square" alt="license">
  </a>
  <a href="https://pypi.python.org/pypi/nonebot-plugin-gsmaterial">
    <img src="https://img.shields.io/pypi/v/nonebot-plugin-gsmaterial?style=flat-square" alt="pypi">
  </a>
  <img src="https://img.shields.io/badge/python-3.7.3+-blue?style=flat-square" alt="python"><br />
</p></br>


| ![示例](https://user-images.githubusercontent.com/22407052/192959337-beb894be-81c1-41d4-9cc3-3324eed16f97.png) |
|:--:|


## 安装方法


如果你正在使用 2.0.0.beta1 以上版本 NoneBot，推荐使用以下命令安装：


```bash
# 从 nb_cli 安装
python3 -m nb plugin install nonebot-plugin-gsmaterial

# 或从 PyPI 安装
python3 -m pip install nonebot-plugin-gsmaterial
```


<details><summary><i>在 NoneBot 2.0.0.alpha16 上使用此插件</i></summary></br>


在过时的 NoneBot 2.0.0.alpha16 上 **可能** 仍有机会体验此插件！不过，千万不要通过 NoneBot 脚手架或 PyPI 安装，仅支持通过 Git 手动安装此插件。

以下命令仅作参考：


```bash
# 进入 Bot 根目录
cd /path/to/bot
# 安装依赖
# source venv/bin/activate
python3 -m pip install pillow httpx
# 安装插件
git clone https://github.com/monsterxcn/nonebot-plugin-gsmaterial.git
cd nonebot-plugin-gsmaterial
# 将文件夹 nonebot_plugin_gsmaterial 复制到 NoneBot2 插件目录下
cp -r nonebot_plugin_gsmaterial /path/to/bot/plugins/
# 将文件夹 data 下内容复制到 /path/to/bot/data/ 目录下
mkdir /path/to/bot/data
cp -r data/gsmaterial /path/to/bot/data/
```


</details>


## 使用须知


 - 插件的数据来源为 [Project Amber](https://ambr.top/chs)，所有未实装角色及武器的数据均由该数据库提供。
   
 - 插件在 Bot 启动后会自动从阿里云 OSS 下载绘图模板，并尝试从 [Project Amber](https://ambr.top/chs) 下载所有角色及武器图片，启动时间由 Bot 与 [Project Amber](https://ambr.top/chs) 的连接质量决定。图片下载至本地后将不再从远程下载，启动时间将大幅缩短。
   
   **提示**：如果启动插件时下载图片的时间久到离谱，可以考虑自行克隆仓库内文件或从 [此处](https://monsterx.oss-cn-shanghai.aliyuncs.com/bot/gsmaterial/gsmaterial.zip) 下载资源压缩包。
   
 - 一般来说，插件安装完成后无需设置环境变量，只需重启 Bot 即可开始使用。你也可以在 Nonebot2 当前使用的 `.env` 文件中添加下表给出的环境变量，对插件进行更多配置。环境变量修改后需要重启 Bot 才能生效。
   
   | 环境变量 | 必需 | 默认 | 说明 |
   |:-------|:----:|:-----|:----|
   | `gsmaterial_scheduler` | 否 | `"8:10"` | 每日材料订阅推送时间 |
   | `gsmaterial_skip_three` | 否 | `true` | 是否忽略三星物品 |
   | `resources_dir` | 否 | `"/path/to/bot/data/"` | 插件数据缓存目录的父文件夹，包含 `gsmaterial` 文件夹的上级文件夹路径 |
   
 - 插件提供的原神每日材料定时推送基于 [@nonebot/plugin-apscheduler](https://github.com/nonebot/plugin-apscheduler)，如果 NoneBot2 启动时插件的定时任务未正常注册，可能需要额外添加该插件的环境变量 `apscheduler_autostart=true` 来使 `scheduler` 自动启动。


## 命令说明


插件响应以下形式的消息：


 - 以 `今日` / `原神材料` 开头的消息
   
   | 附带参数 | 说明 |
   |:-------|:----|
   | 空 | 返回今日天赋培养与武器突破材料总图 |
   | `天赋` / `角色` | 返回今日天赋培养材料图片 |
   | `武器` | 返回今日武器突破材料图片 |
   | `订阅` | 启用当前消息来源的每日材料订阅，群组内仅 Bot 管理员、群组创建者、群组管理员可操作 |
   | `订阅删除` | 禁用当前消息来源的每日材料订阅，群组内仅 Bot 管理员、群组创建者、群组管理员可操作 |
   
 - 以 `周本` / `原神周本` 开头的消息
   
   | 附带参数 | 说明 |
   |:-------|:----|
   | 空 | 返回周本材料总图 |
   | `风龙` / `风魔龙` | 返回 *风魔龙·特瓦林* 掉落材料图片 |
   | `狼` / `北风狼` / `王狼` | 返回 *安德留斯* 掉落材料图片 |
   | `公子` / `达达利亚` / `可达鸭` / `鸭鸭` | 返回 *「公子」* 掉落材料图片 |
   | `若托` / `若陀` / `龙王` | 返回 *若陀龙王* 掉落材料图片 |
   | `女士` / `罗莎琳` / `魔女` | 返回 *「女士」* 掉落材料图片 |
   | `雷神` / `雷电` / `雷军` / `将军` | 返回 *祸津御建鸣神命* 掉落材料图片 |
   
   ![周本总图](https://user-images.githubusercontent.com/22407052/192950472-76da7edc-e687-4480-b8c3-a242df8a459d.png)


## 特别鸣谢


[@Mrs4s/go-cqhttp](https://github.com/Mrs4s/go-cqhttp) | [@nonebot/nonebot2](https://github.com/nonebot/nonebot2) | [@nonebot/plugin-apscheduler](https://github.com/nonebot/plugin-apscheduler) | [Project Amber](https://ambr.top/chs)

