📖 介绍
基于和风天气的天气查询、订阅与推送插件
在 nonebot-plugin-heweather 的基础上添加了私聊与群聊的天气订阅与推送功能
💿 安装
在 KiramiBot 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install kirami-plugin-qweather
pdm
pdm add kirami-plugin-qweather
poetry
poetry add kirami-plugin-qweather
conda
conda install kirami-plugin-qweather
打开 KiramiBot 项目根目录下的配置文件, 以 kirami.toml 为例,在 [plugin] 部分追加写入
plugins = ["kiramit_plugin_qweather"]
⚙️ 配置
在 KiramiBot 项目的配置文件中添加下表中的必填配置
| 配置项 | 必填 | 默认值 | 说明 |
|---|---|---|---|
| qweather_apikey | 是 | 无 | APIKEY |
| qweather_apitype | 是 | 无 | api 类型 |
| qweather_hourlytype | 否 | 1 | 逐小时天气返回类型:1 = 未来12小时 (默认值) 2 = 未来24小时 |
api类型说明
0 = 普通版 免费订阅 (7 天天气预报, 1000次请求/天)
1 = 个人开发版 标准订阅 (7 天天气预报)
2 = 商业版 (7 天天气预报)
APIKEY获取方式
1、注册和风天气账号
进入官网注册https://id.qweather.com/#/login
2、进入控制台
登录后,点击 “和风天气开发者控制台”
3、创建项目
点击控制台左侧 “项目管理”,然后点击 “创建项目”,根据提示自行填写
“选择订阅” -> “免费订阅”,“设置 KEY” -> “Web API”,都填好后“创建”
4、获取 key
返回 “项目管理”,可以看到创建的项目,点击 KEY 下面的 “查看”。
🎉 使用
指令表
| 指令 | 权限 | 需要@ | 范围 | 说明 |
|---|---|---|---|---|
| 天气 | 用户 | 否 | 全部 | 查询天气,支持跟随城市名、以英文逗号分隔的经纬度 如:北京天气、120.38946,36.07223天气、天气 武汉 |
| 天气订阅 | 用户 | 否 | 全部 | 私人天气订阅,将以私聊形式推送(请确保有机器人好友),命令格式 天气订阅 [地名/经纬度] [推送时间(小时)] 如:天气订阅 北京 10。不跟随推送时间参数默认推送时间为早上8点 |
| 查询天气订阅 | 用户 | 否 | 全部 | 查询你的私人天气订阅 |
| 删除天气订阅 | 群员 | 否 | 群聊 | 按订阅id删除你的天气订阅,订阅id请先执行查询命令获取 |
| 群天气订阅 | 群员 | 否 | 群聊 | 群天气订阅,将在群聊内推送并@订阅者,命令格式同私人订阅 |
| 查询群天气订阅 | 群员 | 否 | 群聊 | 查询你在本群的天气订阅 |
| 删除群天气订阅 | 群员 | 否 | 群聊 | 按订阅id删除你在本群的天气订阅,订阅id请先执行查询命令获取 |
效果图
Metadata
Release files for kirami-plugin-qweather 0.1.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 |
|---|---|---|---|---|
| kirami_plugin_qweather-0.1.1.tar.gz | 97.0 kB | Without provenance | Details for kirami_plugin_qweather-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kirami_plugin_qweather-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for kirami_plugin_qweather-0.1.1-py3-none-any.whl |
Total release size: 193.0 kB
Release files / kirami_plugin_qweather-0.1.1.tar.gz
| Download URL | kirami_plugin_qweather-0.1.1.tar.gz |
|---|---|
| Size | 97.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
124d6d705df0784d4a0d22f53cdb48e08d43c27f68b6b8878bec76c36f783286
|
|
BLAKE2b-256 checksum How to use checksums |
6be9fea9090f91fe98afc3092efb00efa4a50c2155cf984628cbf0942c97d3ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Release files / kirami_plugin_qweather-0.1.1-py3-none-any.whl
| Download URL | kirami_plugin_qweather-0.1.1-py3-none-any.whl |
|---|---|
| Size | 96.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
15a7191f181d6e04243780bef7ef7c89a3bbeb84871de6002389de8b5cd45946
|
|
BLAKE2b-256 checksum How to use checksums |
2f4207c8b12f25b7b16bedc94f737eaf445714bf2659780d18bb3e9b7b206a28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Security for kirami-plugin-qweather 0.1.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.