Metadata-Version: 2.5
Name: nonebot-plugin-metals
Version: 0.2.0
Summary: NoneBot2 plugin for querying domestic gold realtime prices
Project-URL: Homepage, https://github.com/ByteColtX/nonebot-plugin-metals
Project-URL: Issues, https://github.com/ByteColtX/nonebot-plugin-metals/issues
Project-URL: Repository, https://github.com/ByteColtX/nonebot-plugin-metals.git
Author-email: ByteColtX <umk@live.com>
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: httpx<1.0.0,>=0.27.0
Requires-Dist: nonebot2<3.0.0,>=2.2.0
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-metals ✨
[![LICENSE](https://img.shields.io/github/license/ByteColtX/nonebot-plugin-metals.svg)](./LICENSE)
[![pypi](https://img.shields.io/pypi/v/nonebot-plugin-metals.svg)](https://pypi.python.org/pypi/nonebot-plugin-metals)
[![python](https://img.shields.io/badge/python-3.10|3.11|3.12|3.13-blue.svg)](https://www.python.org)
[![uv](https://img.shields.io/badge/package%20manager-uv-black?style=flat-square&logo=uv)](https://github.com/astral-sh/uv)
<br/>
[![ruff](https://img.shields.io/badge/code%20style-ruff-black?style=flat-square&logo=ruff)](https://github.com/astral-sh/ruff)

</div>

## 📖 介绍

基于招商银行公开接口的 NoneBot 黄金行情插件，查询 AU9999 的实时行情。
插件通过 `nonebot_plugin_metals` 模块加载，关键词仅匹配整条消息，且不区分大小写。

## 💿 安装

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

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

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

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

</details>

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

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

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

    uv add git+https://github.com/ByteColtX/nonebot-plugin-metals@master
</details>

<details>
<summary>pdm</summary>

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

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

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

    poetry add git+https://github.com/ByteColtX/nonebot-plugin-metals@master
</details>

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

    plugins = ["nonebot_plugin_metals"]

</details>

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

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

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

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

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

</details>

## ⚙️ 配置

插件不需要额外配置。行情数据来自招商银行公开接口，查询 AU9999 黄金实时行情。

## 🎉 使用

### 指令表

| 指令 | 权限 | 需要@ | 范围 | 说明 |
| :--- | :--- | :--- | :--- | :--- |
| 发送 `黄金` | 群员 | 否 | 群聊、私聊 | 查询 AU9999 黄金实时行情 |
| 发送 `au99` | 群员 | 否 | 群聊、私聊 | 查询 AU9999 黄金实时行情 |
| 发送 `gold` | 群员 | 否 | 群聊、私聊 | 查询 AU9999 黄金实时行情 |
| 发送 `金块` | 群员 | 否 | 群聊、私聊 | 查询 AU9999 黄金实时行情 |

以上关键词必须单独作为整条消息发送，关键词不区分大小写。

### 黄金行情

```text
黄金
au99
gold
金块
```

返回内容包括获取日期、黄金品种、最新价、开盘价、昨收盘、最高价、最低价、平均价、成交量、涨跌额、涨跌幅和更新时间。

网络超时、HTTP 错误或接口响应格式异常时，插件会返回对应的错误提示。

### 🎨 效果图

暂无示例图。
