nonebot-plugin-apod 0.0.2__tar.gz → 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nonebot_plugin_apod-0.0.3/PKG-INFO +85 -0
- nonebot_plugin_apod-0.0.3/README.md +57 -0
- {nonebot_plugin_apod-0.0.2 → nonebot_plugin_apod-0.0.3}/nonebot_plugin_apod/__init__.py +4 -4
- {nonebot_plugin_apod-0.0.2 → nonebot_plugin_apod-0.0.3}/nonebot_plugin_apod/apod.py +1 -1
- {nonebot_plugin_apod-0.0.2 → nonebot_plugin_apod-0.0.3}/nonebot_plugin_apod/config.py +2 -2
- {nonebot_plugin_apod-0.0.2 → nonebot_plugin_apod-0.0.3}/pyproject.toml +1 -1
- nonebot_plugin_apod-0.0.2/PKG-INFO +0 -29
- nonebot_plugin_apod-0.0.2/README.md +0 -1
- {nonebot_plugin_apod-0.0.2 → nonebot_plugin_apod-0.0.3}/LICENSE +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: nonebot-plugin-apod
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: 定时发送 NASA 每日提供的天文图片
|
|
5
|
+
Home-page: https://github.com/lyqgzbl/nonebot-plugin-apod
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: nonebot2,NASA
|
|
8
|
+
Author: lyqgzbl
|
|
9
|
+
Author-email: admin@lyqgzbl.com
|
|
10
|
+
Requires-Python: >=3.8,<4.0
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Requires-Dist: httpx (>=0.28.0,<0.29.0)
|
|
20
|
+
Requires-Dist: nonebot-plugin-alconna (>=0.54.0,<0.55.0)
|
|
21
|
+
Requires-Dist: nonebot-plugin-apscheduler (>=0.5.0,<0.6.0)
|
|
22
|
+
Requires-Dist: nonebot-plugin-localstore (>=0.7.0,<0.8.0)
|
|
23
|
+
Requires-Dist: nonebot-plugin-send-anything-anywhere (>=0.7.0,<0.8.0)
|
|
24
|
+
Requires-Dist: nonebot2 (>=2.2.1,<3.0.0)
|
|
25
|
+
Project-URL: Documentation, https://github.com/lyqgzbl/nonebot-plugin-apod#readme
|
|
26
|
+
Project-URL: Repository, https://github.com/lyqgzbl/nonebot-plugin-apod
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
<!-- markdownlint-disable MD033 MD036 MD041 -->
|
|
30
|
+
|
|
31
|
+
<div align="center">
|
|
32
|
+
|
|
33
|
+
<a href="https://v2.nonebot.dev/store">
|
|
34
|
+
<img src="https://raw.githubusercontent.com/A-kirami/nonebot-plugin-template/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo">
|
|
35
|
+
</a>
|
|
36
|
+
|
|
37
|
+
<p>
|
|
38
|
+
<img src="https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/template/plugin.svg" alt="NoneBotPluginText">
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
# nonebot-plugin-apod
|
|
42
|
+
|
|
43
|
+
_✨ 每日天文一图 ✨_
|
|
44
|
+
|
|
45
|
+

|
|
46
|
+

|
|
47
|
+

|
|
48
|
+
[](https://registry.nonebot.dev/plugin/nonebot-plugin-apod:nonebot_plugin_apod)
|
|
49
|
+
[](https://registry.nonebot.dev/plugin/nonebot-plugin-send-anything-anywhere:nonebot_plugin_saa)
|
|
50
|
+
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
## 安装
|
|
54
|
+
使用nb-cli [推荐]
|
|
55
|
+
```shell
|
|
56
|
+
nb plugin install nonebot-plugin-apod
|
|
57
|
+
```
|
|
58
|
+
使用pip
|
|
59
|
+
```shell
|
|
60
|
+
pip install nonebot-plugin-apod
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 使用
|
|
64
|
+
命令需要加 [NoneBot 命令前缀](https://nonebot.dev/docs/appendices/config#command-start-和-command-separator) (默认为`/`)
|
|
65
|
+
命令需要用户为 [SuperUsers](https://nonebot.dev/docs/appendices/config#superusers)
|
|
66
|
+
使用命令`APOD`/`apod`触发插件
|
|
67
|
+
命令选项`状态` 查询定时任务状态
|
|
68
|
+
命令选项`关闭` 关闭定时任务
|
|
69
|
+
命令选项`开启` 开启定时任务
|
|
70
|
+
|
|
71
|
+
## 配置项
|
|
72
|
+
|
|
73
|
+
配置方式:直接在 NoneBot 全局配置文件中添加以下配置项即可
|
|
74
|
+
|
|
75
|
+
### nasa_api_key [必填]
|
|
76
|
+
|
|
77
|
+
- 类型:`str`
|
|
78
|
+
- 默认值:`None`
|
|
79
|
+
- 说明:用于获取每日天文一图的 NASA API Key
|
|
80
|
+
|
|
81
|
+
### default_apod_send_time [选填]
|
|
82
|
+
|
|
83
|
+
- 类型:`str`
|
|
84
|
+
- 默认值:`13:00`
|
|
85
|
+
- 说明:每日天文一图的默认发送时间
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!-- markdownlint-disable MD033 MD036 MD041 -->
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
<a href="https://v2.nonebot.dev/store">
|
|
6
|
+
<img src="https://raw.githubusercontent.com/A-kirami/nonebot-plugin-template/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo">
|
|
7
|
+
</a>
|
|
8
|
+
|
|
9
|
+
<p>
|
|
10
|
+
<img src="https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/template/plugin.svg" alt="NoneBotPluginText">
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
# nonebot-plugin-apod
|
|
14
|
+
|
|
15
|
+
_✨ 每日天文一图 ✨_
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+

|
|
19
|
+

|
|
20
|
+
[](https://registry.nonebot.dev/plugin/nonebot-plugin-apod:nonebot_plugin_apod)
|
|
21
|
+
[](https://registry.nonebot.dev/plugin/nonebot-plugin-send-anything-anywhere:nonebot_plugin_saa)
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
## 安装
|
|
26
|
+
使用nb-cli [推荐]
|
|
27
|
+
```shell
|
|
28
|
+
nb plugin install nonebot-plugin-apod
|
|
29
|
+
```
|
|
30
|
+
使用pip
|
|
31
|
+
```shell
|
|
32
|
+
pip install nonebot-plugin-apod
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 使用
|
|
36
|
+
命令需要加 [NoneBot 命令前缀](https://nonebot.dev/docs/appendices/config#command-start-和-command-separator) (默认为`/`)
|
|
37
|
+
命令需要用户为 [SuperUsers](https://nonebot.dev/docs/appendices/config#superusers)
|
|
38
|
+
使用命令`APOD`/`apod`触发插件
|
|
39
|
+
命令选项`状态` 查询定时任务状态
|
|
40
|
+
命令选项`关闭` 关闭定时任务
|
|
41
|
+
命令选项`开启` 开启定时任务
|
|
42
|
+
|
|
43
|
+
## 配置项
|
|
44
|
+
|
|
45
|
+
配置方式:直接在 NoneBot 全局配置文件中添加以下配置项即可
|
|
46
|
+
|
|
47
|
+
### nasa_api_key [必填]
|
|
48
|
+
|
|
49
|
+
- 类型:`str`
|
|
50
|
+
- 默认值:`None`
|
|
51
|
+
- 说明:用于获取每日天文一图的 NASA API Key
|
|
52
|
+
|
|
53
|
+
### default_apod_send_time [选填]
|
|
54
|
+
|
|
55
|
+
- 类型:`str`
|
|
56
|
+
- 默认值:`13:00`
|
|
57
|
+
- 说明:每日天文一图的默认发送时间
|
|
@@ -35,11 +35,12 @@ __plugin_meta__ = PluginMetadata(
|
|
|
35
35
|
|
|
36
36
|
enable_auto_select_bot()
|
|
37
37
|
plugin_config = get_plugin_config(Config)
|
|
38
|
-
|
|
38
|
+
task_config_file = store.get_plugin_data_file("apod_task_config.json")
|
|
39
|
+
if not plugin_config.apod_api_key:
|
|
39
40
|
logger.opt(colors=True).warning("<yellow>缺失必要配置项 'nasa_api_key',已禁用该插件</yellow>")
|
|
40
41
|
def is_enable() -> Rule:
|
|
41
42
|
def _rule() -> bool:
|
|
42
|
-
return bool(plugin_config.
|
|
43
|
+
return bool(plugin_config.apod_api_key)
|
|
43
44
|
return Rule(_rule)
|
|
44
45
|
|
|
45
46
|
|
|
@@ -79,7 +80,6 @@ def is_valid_time_format(time_str: str) -> bool:
|
|
|
79
80
|
|
|
80
81
|
@apod.assign("status")
|
|
81
82
|
async def apod_status(event):
|
|
82
|
-
task_config_file = store.get_plugin_data_file("apod_task_config.json")
|
|
83
83
|
if not task_config_file.exists():
|
|
84
84
|
await apod.finish("NASA 每日天文一图定时任务未开启")
|
|
85
85
|
try:
|
|
@@ -128,6 +128,6 @@ async def apod_start(send_time: Match[str], target: SaaTarget):
|
|
|
128
128
|
logger.error(f"设置 NASA 每日天文一图定时任务时发生错误:{e}")
|
|
129
129
|
await apod.finish("设置 NASA 每日天文一图定时任务时发生错误")
|
|
130
130
|
else:
|
|
131
|
-
default_time = plugin_config.
|
|
131
|
+
default_time = plugin_config.apod_default_send_time
|
|
132
132
|
schedule_apod_task(default_time, target)
|
|
133
133
|
await apod.finish(f"已开启 NASA 每日天文一图定时任务,默认发送时间为 {default_time}")
|
|
@@ -11,7 +11,7 @@ from .config import Config
|
|
|
11
11
|
|
|
12
12
|
plugin_config = get_plugin_config(Config)
|
|
13
13
|
NASA_API_URL = "https://api.nasa.gov/planetary/apod"
|
|
14
|
-
NASA_API_KEY = plugin_config.
|
|
14
|
+
NASA_API_KEY = plugin_config.apod_api_key
|
|
15
15
|
task_config_file = store.get_plugin_data_file("apod_task_config.json")
|
|
16
16
|
|
|
17
17
|
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: nonebot-plugin-apod
|
|
3
|
-
Version: 0.0.2
|
|
4
|
-
Summary: 定时发送 NASA 每日提供的天文图片
|
|
5
|
-
Home-page: https://github.com/lyqgzbl/nonebot-plugin-apod
|
|
6
|
-
License: MIT
|
|
7
|
-
Keywords: nonebot2,NASA
|
|
8
|
-
Author: lyqgzbl
|
|
9
|
-
Author-email: admin@lyqgzbl.com
|
|
10
|
-
Requires-Python: >=3.8,<4.0
|
|
11
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
-
Requires-Dist: httpx (>=0.28.0,<0.29.0)
|
|
20
|
-
Requires-Dist: nonebot-plugin-alconna (>=0.54.0,<0.55.0)
|
|
21
|
-
Requires-Dist: nonebot-plugin-apscheduler (>=0.5.0,<0.6.0)
|
|
22
|
-
Requires-Dist: nonebot-plugin-localstore (>=0.7.0,<0.8.0)
|
|
23
|
-
Requires-Dist: nonebot-plugin-send-anything-anywhere (>=0.7.0,<0.8.0)
|
|
24
|
-
Requires-Dist: nonebot2 (>=2.2.1,<3.0.0)
|
|
25
|
-
Project-URL: Documentation, https://github.com/lyqgzbl/nonebot-plugin-apod#readme
|
|
26
|
-
Project-URL: Repository, https://github.com/lyqgzbl/nonebot-plugin-apod
|
|
27
|
-
Description-Content-Type: text/markdown
|
|
28
|
-
|
|
29
|
-
# nonebot-plugin-apod
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# nonebot-plugin-apod
|
|
File without changes
|