ErisPulse-Reminder 0.1.0__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.
@@ -0,0 +1,124 @@
1
+ Metadata-Version: 2.4
2
+ Name: ErisPulse-Reminder
3
+ Version: 0.1.0
4
+ Summary: 提醒模块:/提醒 <时长> <内容> 定时提醒,重启自动恢复
5
+ Author: wsu2059q
6
+ License: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Provides-Extra: test
11
+ Requires-Dist: pytest>=7.0; extra == "test"
12
+ Requires-Dist: pytest-asyncio>=0.21; extra == "test"
13
+ Requires-Dist: ErisPulse-Testing; extra == "test"
14
+ Dynamic: license-file
15
+
16
+ <div align="center">
17
+
18
+ <img src=".github/assets/ErisPulseLogo.png" width="180" alt="ErisPulse Reminder" />
19
+
20
+ # ErisPulse Reminder
21
+
22
+ **提醒模块 —— 聊天中设置定时提醒,重启自动恢复。**
23
+
24
+ 基于 ErisPulse 2.10 归属化调度(spawn_later)与内置 ORM 的轻量提醒模块,支持声明式时长参数与多轮恢复。
25
+
26
+ <p>
27
+ <a href="https://pypi.org/project/ErisPulse-Reminder/"><img src="https://img.shields.io/pypi/v/ErisPulse-Reminder?style=for-the-badge&logo=pypi&logoColor=white" alt="PyPI"></a>
28
+ <a href="https://pypi.org/project/ErisPulse-Reminder/"><img src="https://img.shields.io/badge/Python-3.10+-FFD43B?style=for-the-badge&logo=python&logoColor=blue" alt="Python"></a>
29
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue?style=for-the-badge" alt="License"></a>
30
+ <a href="https://github.com/ErisPulse/ErisPulse-Reminder"><img src="https://img.shields.io/github/stars/ErisPulse/ErisPulse-Reminder?style=for-the-badge&logo=github&color=brightgreen" alt="Stars"></a>
31
+ <a href="https://pepy.tech/project/ErisPulse-Reminder"><img src="https://img.shields.io/pepy/dt/ErisPulse-Reminder?style=for-the-badge&color=blue" alt="Downloads"></a>
32
+ <a href="https://github.com/ErisPulse/ErisPulse"><img src="https://img.shields.io/badge/Powered_by-ErisPulse-FF6B9D?style=for-the-badge&logo=bookstack&logoColor=white" alt="ErisPulse"></a>
33
+ </p>
34
+
35
+ <p>
36
+ <a href="./README.md">简体中文</a> | <a href="./README.en.md">English</a>
37
+ </p>
38
+
39
+ </div>
40
+
41
+ ---
42
+
43
+ ## 简介
44
+
45
+ Reminder 是基于 [ErisPulse](https://github.com/ErisPulse/ErisPulse/) 架构开发的轻量提醒模块:
46
+
47
+ - `/提醒 30m 喝水`:声明式时长参数(`90s` / `1h30m` / `1d` 等自动折算秒)
48
+ - 到期经适配器发送到原会话(私聊/群聊均可)
49
+ - 提醒记录内置 ORM 持久化,**重启自动恢复**:未到期重新调度,已过期立即补发
50
+ - 调度任务归属化(`spawn_later` owner),模块卸载时自动取消
51
+ - 每用户挂起上限、单条时长上限、内容长度约束
52
+ - 列表经 Takumi 渲染为卡片,不可用时降级文本
53
+
54
+ 要求 ErisPulse >= 2.10.0。
55
+
56
+ ---
57
+
58
+ ## 效果展示
59
+
60
+ | `/提醒 列表` |
61
+ |:---:|
62
+ | ![list](.github/assets/demo/list-light.png) |
63
+
64
+ ---
65
+
66
+
67
+ ---
68
+
69
+ ## 安装
70
+
71
+ ```bash
72
+ epsdk install ErisPulse-Reminder
73
+ ```
74
+
75
+ ---
76
+
77
+ ## 命令
78
+
79
+ | 命令 | 说明 |
80
+ |------|------|
81
+ | `/提醒 <时长> <内容>` | 设置提醒,如 `/提醒 30m 喝水`、`/提醒 1h30m 下线休息` |
82
+ | `/提醒 列表` | 查看本人的待触发提醒 |
83
+ | `/提醒 取消 <编号>` | 取消一条提醒 |
84
+
85
+ 时长语法:`90s`(秒)、`30m`(分)、`2h`(时)、`1d`(天),可组合如 `1h30m`。
86
+
87
+ ---
88
+
89
+ ## 配置说明
90
+
91
+ ```toml
92
+ [Reminder]
93
+ max_reminders_per_user = 20 # 单用户同时挂起的提醒上限
94
+ max_duration = "30d" # 单条提醒最大时长
95
+ reminder_prefix = "提醒:" # 到期消息前缀
96
+ list_max = 10 # 列表单次展示条数
97
+ render_card = true # 列表用 Takumi 渲染为卡片
98
+ theme = "auto" # 卡片配色 (auto/light/dark)
99
+ ```
100
+
101
+ | 配置项 | 类型 | 默认值 | 说明 |
102
+ |--------|------|--------|------|
103
+ | `max_reminders_per_user` | int | `20` | 每用户挂起上限 |
104
+ | `max_duration` | str | `30d` | 单条最大时长 |
105
+ | `reminder_prefix` | str | `提醒:` | 到期消息前缀 |
106
+ | `list_max` | int | `10` | 列表条数 |
107
+ | `render_card` | bool | `true` | 卡片渲染 |
108
+ | `theme` | str | `auto` | 卡片配色 |
109
+
110
+ ---
111
+
112
+ ## 注意事项
113
+
114
+ 1. 到期发送失败时提醒仍标记完成(避免无限重试),失败记录在日志
115
+ 2. 提醒发送到设置时的原会话(群聊则发回群)
116
+ 3. 记录存储于框架存储后端,随数据一起备份迁移
117
+
118
+ ---
119
+
120
+ ## 参考链接
121
+
122
+ - [ErisPulse 主库](https://github.com/ErisPulse/ErisPulse/)
123
+ - [运行时调度文档](https://github.com/ErisPulse/ErisPulse/tree/main/docs/zh-CN/advanced/connections.md)
124
+ - [ORM 文档](https://github.com/ErisPulse/ErisPulse/tree/main/docs/zh-CN/developer-guide/orm.md)
@@ -0,0 +1,18 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ ErisPulse_Reminder.egg-info/PKG-INFO
5
+ ErisPulse_Reminder.egg-info/SOURCES.txt
6
+ ErisPulse_Reminder.egg-info/dependency_links.txt
7
+ ErisPulse_Reminder.egg-info/entry_points.txt
8
+ ErisPulse_Reminder.egg-info/requires.txt
9
+ ErisPulse_Reminder.egg-info/top_level.txt
10
+ Reminder/Config.py
11
+ Reminder/Core.py
12
+ Reminder/I18n.py
13
+ Reminder/Models.py
14
+ Reminder/Scheduler.py
15
+ Reminder/Visualizer.py
16
+ Reminder/__init__.py
17
+ tests/test_commands.py
18
+ tests/test_scheduler.py
@@ -0,0 +1,2 @@
1
+ [erispulse.module]
2
+ Reminder = Reminder:Main
@@ -0,0 +1,5 @@
1
+
2
+ [test]
3
+ pytest>=7.0
4
+ pytest-asyncio>=0.21
5
+ ErisPulse-Testing
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 wsu2059q
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,124 @@
1
+ Metadata-Version: 2.4
2
+ Name: ErisPulse-Reminder
3
+ Version: 0.1.0
4
+ Summary: 提醒模块:/提醒 <时长> <内容> 定时提醒,重启自动恢复
5
+ Author: wsu2059q
6
+ License: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Provides-Extra: test
11
+ Requires-Dist: pytest>=7.0; extra == "test"
12
+ Requires-Dist: pytest-asyncio>=0.21; extra == "test"
13
+ Requires-Dist: ErisPulse-Testing; extra == "test"
14
+ Dynamic: license-file
15
+
16
+ <div align="center">
17
+
18
+ <img src=".github/assets/ErisPulseLogo.png" width="180" alt="ErisPulse Reminder" />
19
+
20
+ # ErisPulse Reminder
21
+
22
+ **提醒模块 —— 聊天中设置定时提醒,重启自动恢复。**
23
+
24
+ 基于 ErisPulse 2.10 归属化调度(spawn_later)与内置 ORM 的轻量提醒模块,支持声明式时长参数与多轮恢复。
25
+
26
+ <p>
27
+ <a href="https://pypi.org/project/ErisPulse-Reminder/"><img src="https://img.shields.io/pypi/v/ErisPulse-Reminder?style=for-the-badge&logo=pypi&logoColor=white" alt="PyPI"></a>
28
+ <a href="https://pypi.org/project/ErisPulse-Reminder/"><img src="https://img.shields.io/badge/Python-3.10+-FFD43B?style=for-the-badge&logo=python&logoColor=blue" alt="Python"></a>
29
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue?style=for-the-badge" alt="License"></a>
30
+ <a href="https://github.com/ErisPulse/ErisPulse-Reminder"><img src="https://img.shields.io/github/stars/ErisPulse/ErisPulse-Reminder?style=for-the-badge&logo=github&color=brightgreen" alt="Stars"></a>
31
+ <a href="https://pepy.tech/project/ErisPulse-Reminder"><img src="https://img.shields.io/pepy/dt/ErisPulse-Reminder?style=for-the-badge&color=blue" alt="Downloads"></a>
32
+ <a href="https://github.com/ErisPulse/ErisPulse"><img src="https://img.shields.io/badge/Powered_by-ErisPulse-FF6B9D?style=for-the-badge&logo=bookstack&logoColor=white" alt="ErisPulse"></a>
33
+ </p>
34
+
35
+ <p>
36
+ <a href="./README.md">简体中文</a> | <a href="./README.en.md">English</a>
37
+ </p>
38
+
39
+ </div>
40
+
41
+ ---
42
+
43
+ ## 简介
44
+
45
+ Reminder 是基于 [ErisPulse](https://github.com/ErisPulse/ErisPulse/) 架构开发的轻量提醒模块:
46
+
47
+ - `/提醒 30m 喝水`:声明式时长参数(`90s` / `1h30m` / `1d` 等自动折算秒)
48
+ - 到期经适配器发送到原会话(私聊/群聊均可)
49
+ - 提醒记录内置 ORM 持久化,**重启自动恢复**:未到期重新调度,已过期立即补发
50
+ - 调度任务归属化(`spawn_later` owner),模块卸载时自动取消
51
+ - 每用户挂起上限、单条时长上限、内容长度约束
52
+ - 列表经 Takumi 渲染为卡片,不可用时降级文本
53
+
54
+ 要求 ErisPulse >= 2.10.0。
55
+
56
+ ---
57
+
58
+ ## 效果展示
59
+
60
+ | `/提醒 列表` |
61
+ |:---:|
62
+ | ![list](.github/assets/demo/list-light.png) |
63
+
64
+ ---
65
+
66
+
67
+ ---
68
+
69
+ ## 安装
70
+
71
+ ```bash
72
+ epsdk install ErisPulse-Reminder
73
+ ```
74
+
75
+ ---
76
+
77
+ ## 命令
78
+
79
+ | 命令 | 说明 |
80
+ |------|------|
81
+ | `/提醒 <时长> <内容>` | 设置提醒,如 `/提醒 30m 喝水`、`/提醒 1h30m 下线休息` |
82
+ | `/提醒 列表` | 查看本人的待触发提醒 |
83
+ | `/提醒 取消 <编号>` | 取消一条提醒 |
84
+
85
+ 时长语法:`90s`(秒)、`30m`(分)、`2h`(时)、`1d`(天),可组合如 `1h30m`。
86
+
87
+ ---
88
+
89
+ ## 配置说明
90
+
91
+ ```toml
92
+ [Reminder]
93
+ max_reminders_per_user = 20 # 单用户同时挂起的提醒上限
94
+ max_duration = "30d" # 单条提醒最大时长
95
+ reminder_prefix = "提醒:" # 到期消息前缀
96
+ list_max = 10 # 列表单次展示条数
97
+ render_card = true # 列表用 Takumi 渲染为卡片
98
+ theme = "auto" # 卡片配色 (auto/light/dark)
99
+ ```
100
+
101
+ | 配置项 | 类型 | 默认值 | 说明 |
102
+ |--------|------|--------|------|
103
+ | `max_reminders_per_user` | int | `20` | 每用户挂起上限 |
104
+ | `max_duration` | str | `30d` | 单条最大时长 |
105
+ | `reminder_prefix` | str | `提醒:` | 到期消息前缀 |
106
+ | `list_max` | int | `10` | 列表条数 |
107
+ | `render_card` | bool | `true` | 卡片渲染 |
108
+ | `theme` | str | `auto` | 卡片配色 |
109
+
110
+ ---
111
+
112
+ ## 注意事项
113
+
114
+ 1. 到期发送失败时提醒仍标记完成(避免无限重试),失败记录在日志
115
+ 2. 提醒发送到设置时的原会话(群聊则发回群)
116
+ 3. 记录存储于框架存储后端,随数据一起备份迁移
117
+
118
+ ---
119
+
120
+ ## 参考链接
121
+
122
+ - [ErisPulse 主库](https://github.com/ErisPulse/ErisPulse/)
123
+ - [运行时调度文档](https://github.com/ErisPulse/ErisPulse/tree/main/docs/zh-CN/advanced/connections.md)
124
+ - [ORM 文档](https://github.com/ErisPulse/ErisPulse/tree/main/docs/zh-CN/developer-guide/orm.md)
@@ -0,0 +1,109 @@
1
+ <div align="center">
2
+
3
+ <img src=".github/assets/ErisPulseLogo.png" width="180" alt="ErisPulse Reminder" />
4
+
5
+ # ErisPulse Reminder
6
+
7
+ **提醒模块 —— 聊天中设置定时提醒,重启自动恢复。**
8
+
9
+ 基于 ErisPulse 2.10 归属化调度(spawn_later)与内置 ORM 的轻量提醒模块,支持声明式时长参数与多轮恢复。
10
+
11
+ <p>
12
+ <a href="https://pypi.org/project/ErisPulse-Reminder/"><img src="https://img.shields.io/pypi/v/ErisPulse-Reminder?style=for-the-badge&logo=pypi&logoColor=white" alt="PyPI"></a>
13
+ <a href="https://pypi.org/project/ErisPulse-Reminder/"><img src="https://img.shields.io/badge/Python-3.10+-FFD43B?style=for-the-badge&logo=python&logoColor=blue" alt="Python"></a>
14
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue?style=for-the-badge" alt="License"></a>
15
+ <a href="https://github.com/ErisPulse/ErisPulse-Reminder"><img src="https://img.shields.io/github/stars/ErisPulse/ErisPulse-Reminder?style=for-the-badge&logo=github&color=brightgreen" alt="Stars"></a>
16
+ <a href="https://pepy.tech/project/ErisPulse-Reminder"><img src="https://img.shields.io/pepy/dt/ErisPulse-Reminder?style=for-the-badge&color=blue" alt="Downloads"></a>
17
+ <a href="https://github.com/ErisPulse/ErisPulse"><img src="https://img.shields.io/badge/Powered_by-ErisPulse-FF6B9D?style=for-the-badge&logo=bookstack&logoColor=white" alt="ErisPulse"></a>
18
+ </p>
19
+
20
+ <p>
21
+ <a href="./README.md">简体中文</a> | <a href="./README.en.md">English</a>
22
+ </p>
23
+
24
+ </div>
25
+
26
+ ---
27
+
28
+ ## 简介
29
+
30
+ Reminder 是基于 [ErisPulse](https://github.com/ErisPulse/ErisPulse/) 架构开发的轻量提醒模块:
31
+
32
+ - `/提醒 30m 喝水`:声明式时长参数(`90s` / `1h30m` / `1d` 等自动折算秒)
33
+ - 到期经适配器发送到原会话(私聊/群聊均可)
34
+ - 提醒记录内置 ORM 持久化,**重启自动恢复**:未到期重新调度,已过期立即补发
35
+ - 调度任务归属化(`spawn_later` owner),模块卸载时自动取消
36
+ - 每用户挂起上限、单条时长上限、内容长度约束
37
+ - 列表经 Takumi 渲染为卡片,不可用时降级文本
38
+
39
+ 要求 ErisPulse >= 2.10.0。
40
+
41
+ ---
42
+
43
+ ## 效果展示
44
+
45
+ | `/提醒 列表` |
46
+ |:---:|
47
+ | ![list](.github/assets/demo/list-light.png) |
48
+
49
+ ---
50
+
51
+
52
+ ---
53
+
54
+ ## 安装
55
+
56
+ ```bash
57
+ epsdk install ErisPulse-Reminder
58
+ ```
59
+
60
+ ---
61
+
62
+ ## 命令
63
+
64
+ | 命令 | 说明 |
65
+ |------|------|
66
+ | `/提醒 <时长> <内容>` | 设置提醒,如 `/提醒 30m 喝水`、`/提醒 1h30m 下线休息` |
67
+ | `/提醒 列表` | 查看本人的待触发提醒 |
68
+ | `/提醒 取消 <编号>` | 取消一条提醒 |
69
+
70
+ 时长语法:`90s`(秒)、`30m`(分)、`2h`(时)、`1d`(天),可组合如 `1h30m`。
71
+
72
+ ---
73
+
74
+ ## 配置说明
75
+
76
+ ```toml
77
+ [Reminder]
78
+ max_reminders_per_user = 20 # 单用户同时挂起的提醒上限
79
+ max_duration = "30d" # 单条提醒最大时长
80
+ reminder_prefix = "提醒:" # 到期消息前缀
81
+ list_max = 10 # 列表单次展示条数
82
+ render_card = true # 列表用 Takumi 渲染为卡片
83
+ theme = "auto" # 卡片配色 (auto/light/dark)
84
+ ```
85
+
86
+ | 配置项 | 类型 | 默认值 | 说明 |
87
+ |--------|------|--------|------|
88
+ | `max_reminders_per_user` | int | `20` | 每用户挂起上限 |
89
+ | `max_duration` | str | `30d` | 单条最大时长 |
90
+ | `reminder_prefix` | str | `提醒:` | 到期消息前缀 |
91
+ | `list_max` | int | `10` | 列表条数 |
92
+ | `render_card` | bool | `true` | 卡片渲染 |
93
+ | `theme` | str | `auto` | 卡片配色 |
94
+
95
+ ---
96
+
97
+ ## 注意事项
98
+
99
+ 1. 到期发送失败时提醒仍标记完成(避免无限重试),失败记录在日志
100
+ 2. 提醒发送到设置时的原会话(群聊则发回群)
101
+ 3. 记录存储于框架存储后端,随数据一起备份迁移
102
+
103
+ ---
104
+
105
+ ## 参考链接
106
+
107
+ - [ErisPulse 主库](https://github.com/ErisPulse/ErisPulse/)
108
+ - [运行时调度文档](https://github.com/ErisPulse/ErisPulse/tree/main/docs/zh-CN/advanced/connections.md)
109
+ - [ORM 文档](https://github.com/ErisPulse/ErisPulse/tree/main/docs/zh-CN/developer-guide/orm.md)
@@ -0,0 +1,55 @@
1
+ from dataclasses import dataclass, field
2
+
3
+ from ErisPulse.Core.Bases import BaseConfig
4
+
5
+
6
+ @dataclass
7
+ class ReminderConfig(BaseConfig):
8
+
9
+ max_reminders_per_user: int = field(
10
+ default=20,
11
+ metadata={
12
+ "description": {"i18n": "Reminder.max_reminders_per_user", "default": "单个用户同时挂起的提醒上限"},
13
+ "ui": {"widget": "number", "group": "limit", "order": 1},
14
+ },
15
+ )
16
+ max_duration: str = field(
17
+ default="30d",
18
+ metadata={
19
+ "description": {"i18n": "Reminder.max_duration", "default": "单条提醒的最大时长(如 30d、12h)"},
20
+ "ui": {"widget": "text", "group": "limit", "order": 2},
21
+ },
22
+ )
23
+ reminder_prefix: str = field(
24
+ default="提醒:",
25
+ metadata={
26
+ "description": {"i18n": "Reminder.reminder_prefix", "default": "到期消息的文案前缀"},
27
+ "ui": {"widget": "text", "group": "basic", "order": 3},
28
+ },
29
+ )
30
+ list_max: int = field(
31
+ default=10,
32
+ metadata={
33
+ "description": {"i18n": "Reminder.list_max", "default": "列表单次展示的提醒条数"},
34
+ "ui": {"widget": "number", "group": "report", "order": 4},
35
+ },
36
+ )
37
+ render_card: bool = field(
38
+ default=True,
39
+ metadata={
40
+ "description": {"i18n": "Reminder.render_card", "default": "列表用 Takumi 渲染为卡片(不可用时降级文本)"},
41
+ "ui": {"widget": "switch", "group": "render", "order": 5},
42
+ },
43
+ )
44
+ theme: str = field(
45
+ default="auto",
46
+ metadata={
47
+ "description": {"i18n": "Reminder.theme", "default": "卡片配色 (auto=按时间自动切深浅色)"},
48
+ "ui": {
49
+ "widget": "select",
50
+ "options": ["auto", "light", "dark"],
51
+ "group": "render",
52
+ "order": 6,
53
+ },
54
+ },
55
+ )