📖 介绍
基于 Binance Public API 的 NoneBot 加密货币行情插件,支持实时行情和交易对列表查询。
插件仅使用 /crypto 作为行情查询命令,CI 验证 Python 3.10 至 3.14。
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-crypto --upgrade
使用 pypi 源安装
nb plugin install nonebot-plugin-crypto --upgrade -i "https://pypi.org/simple"
使用清华源安装
nb plugin install nonebot-plugin-crypto --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令uv
uv add nonebot-plugin-crypto
安装仓库 master 分支
uv add git+https://github.com/ByteColtX/nonebot-plugin-crypto@master
pdm
pdm add nonebot-plugin-crypto
安装仓库 master 分支
pdm add git+https://github.com/ByteColtX/nonebot-plugin-crypto@master
poetry
poetry add nonebot-plugin-crypto
安装仓库 master 分支
poetry add git+https://github.com/ByteColtX/nonebot-plugin-crypto@master
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = ["nonebot_plugin_crypto"]
使用 nbr 安装(使用 uv 管理依赖可用)
nbr 是一个基于 uv 的 nb-cli,可以方便地管理 nonebot2
nbr plugin install nonebot-plugin-crypto
使用 pypi 源安装
nbr plugin install nonebot-plugin-crypto -i "https://pypi.org/simple"
使用清华源安装
nbr plugin install nonebot-plugin-crypto -i "https://pypi.tuna.tsinghua.edu.cn/simple"
⚙️ 配置
本插件使用 Binance Public API,无需配置 API Key、Secret 或 Access Token。请勿将个人 配置、代理信息或其他敏感信息提交到代码仓库。
如需通过代理访问 Binance API,可在 NoneBot 配置(如 .env 文件)中设置
crypto_proxy:
CRYPTO_PROXY="http://127.0.0.1:7890"
crypto_proxy 留空时不使用代理,代理地址仅用于访问 Binance API。
🎉 使用
指令表
| 指令 | 权限 | 需要@ | 范围 | 说明 |
|---|---|---|---|---|
/crypto <SYMBOL> |
群员 | 否 | 群聊、私聊 | 查询加密货币实时行情 |
/crypto list [KEYWORD] |
群员 | 否 | 群聊、私聊 | 查询 Binance Spot 交易对列表 |
输入 /crypto --help 可以查看完整帮助信息。
实时行情
/crypto BTC
/crypto ETHUSDT
/crypto SOL/USDT
交易对列表
/crypto list
/crypto list btc
/crypto list usdt
列表数据来自 Binance Spot 交易所,默认只返回状态为 TRADING 的交易对,并通过合并转发发送结果。
热门币种快捷查询
插件内置了一次性获取的 Binance Spot USDT 交易对成交额 Top 20 快照。直接发送榜单中的基础币种,
例如 XRP,即可查询对应行情;榜单不会在运行时自动更新。
🎨 效果图
暂无示例图。
Metadata
Release files for nonebot-plugin-crypto 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_crypto-0.2.1.tar.gz | 9.7 kB | Without provenance | Details for nonebot_plugin_crypto-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_crypto-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_crypto-0.2.1-py3-none-any.whl |
Total release size: 21.9 kB
Release files / nonebot_plugin_crypto-0.2.1.tar.gz
| Download URL | nonebot_plugin_crypto-0.2.1.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
089c8085c682b3a50ae48e1742a4a27c49851128e84317443da8953fc435f162
|
|
BLAKE2b-256 checksum How to use checksums |
29a28f987293067498afa38be2f1248c2e3c1909930e41c1689d282c899031f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / nonebot_plugin_crypto-0.2.1-py3-none-any.whl
| Download URL | nonebot_plugin_crypto-0.2.1-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
51c9b93ef38d236f9a248710c19a6a785431b0e77969cd57a0141e6a7b645920
|
|
BLAKE2b-256 checksum How to use checksums |
7ed0afae9386a92a614e8a5d897a3aa418959c2a18cc242b64fb6b2540866aa4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for nonebot-plugin-crypto 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.