Skip to main content

用于查询实时金价、绘制历史金价的NoneBot2插件

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-gold-price

✨ 查询实时金价 ✨

license pypi python

📖 介绍

查询实时金价;存储查询时的金价到数据库中;绘制历史价格走势对比图;设置价格预警阈值(没什么用);定时推送群聊金价。

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-gold-price
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-gold-price
pdm
pdm add nonebot-plugin-gold-price
poetry
poetry add nonebot-plugin-gold-price
conda
conda install nonebot-plugin-gold-price

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

plugins = ["nonebot_plugin_gold_price"]

⚙️ 配置

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

配置项 必填 默认值 说明
gold_api_token 金价查询的API令牌,TOKEN申请地址
gold_api_interval 1 API请求间隔(秒)
gold_default_days 30 默认查询历史天数
gold_threshold_high 800 上预警阈值
gold_threshold_low 650 下预警阈值
gold_target_groups 定时推送的群号列表,例["123", "456"]
gold_schedule_hour 18 定时任务的小时
gold_schedule_minute 30 定时任务的分钟

🎉 使用

指令表

指令 权限 需要@ 范围 说明
金价 群员 群聊 查询实时金价,并返回默认查询历史天数的价格折线图
金价 x天 群员 群聊 查询实时金价,并返回历史x天的价格折线图
金价 x年 群员 群聊 查询实时金价,并返回历史x年的价格折线图,可为浮点数,例0.1

效果图

image1 image2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_gold_price-0.1.4.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_gold_price-0.1.4-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_gold_price-0.1.4.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_gold_price-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3b3cbf1b779d0a79c7afe66621c8f8213d453b5981d1137d819e81d62b492566
MD5 d0585626f83a3e99d9a7835222e0b663
BLAKE2b-256 9c3a94bc4334df1fa5fd84fcb1bf497beaa396ea55d03e4a95325d73c5c0b911

See more details on using hashes here.

File details

Details for the file nonebot_plugin_gold_price-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_gold_price-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 15ed55f3be3cb18dcd35a0cdeed929cd9372c4d05827959ab9fa88ac4ba35297
MD5 7be3df7cbd3624b65ba7932ce451e8ae
BLAKE2b-256 9e0f9ab0d29522f4f7308e30c9bb95c8a7d7da889f52d9328c819fe077ccd55c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page