Skip to main content

基于和风天气的天气查询、订阅与推送插件

Project description

KiramiBotPluginLogo

kirami-plugin-qweather

✨ 基于和风天气的天气查询、订阅与推送插件 ✨

license pypi python

📖 介绍

基于和风天气的天气查询、订阅与推送插件

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请先执行查询命令获取

效果图

示例1 示例2 示例3

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

kirami_plugin_qweather-0.1.1.tar.gz (97.0 kB view details)

Uploaded Source

Built Distribution

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

kirami_plugin_qweather-0.1.1-py3-none-any.whl (96.0 kB view details)

Uploaded Python 3

File details

Details for the file kirami_plugin_qweather-0.1.1.tar.gz.

File metadata

  • Download URL: kirami_plugin_qweather-0.1.1.tar.gz
  • Upload date:
  • Size: 97.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for kirami_plugin_qweather-0.1.1.tar.gz
Algorithm Hash digest
SHA256 124d6d705df0784d4a0d22f53cdb48e08d43c27f68b6b8878bec76c36f783286
MD5 fc6d47d988c39af1a3c46d58734ca4d9
BLAKE2b-256 6be9fea9090f91fe98afc3092efb00efa4a50c2155cf984628cbf0942c97d3ea

See more details on using hashes here.

File details

Details for the file kirami_plugin_qweather-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for kirami_plugin_qweather-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 15a7191f181d6e04243780bef7ef7c89a3bbeb84871de6002389de8b5cd45946
MD5 73af98f134de351ce6b5530f3fb52059
BLAKE2b-256 2f4207c8b12f25b7b16bedc94f737eaf445714bf2659780d18bb3e9b7b206a28

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