Metadata-Version: 2.4
Name: nonebot-plugin-scheduled-message
Version: 0.1.0
Summary: 超级用户私聊管理：向指定群聊定时发送自定义消息
Project-URL: Homepage, https://github.com/TonyLiangP2010405/nonebot-plugin-scheduled-message
Project-URL: Repository, https://github.com/TonyLiangP2010405/nonebot-plugin-scheduled-message
Author: TonyLiangP2010405
License: MIT
License-File: LICENSE
Keywords: message,nonebot,nonebot2,plugin,scheduled,timer
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Requires-Dist: nonebot-adapter-onebot>=2.4.0
Requires-Dist: nonebot-plugin-apscheduler>=0.3.0
Requires-Dist: nonebot-plugin-localstore>=0.7.0
Requires-Dist: nonebot2>=2.2.0
Provides-Extra: dev
Requires-Dist: nonebot2[fastapi]>=2.2.0; extra == 'dev'
Requires-Dist: nonebug>=0.3; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# nonebot-plugin-scheduled-message

定时消息插件：超级用户在私聊中管理定时任务，机器人按固定间隔向指定群聊发送自定义消息。

## 功能

- 两步交互式添加定时消息：先给群号和间隔，再发送消息内容（支持多行、表情、图片等 CQ 码内容）
- 任务持久化到本地 JSON，重启后自动恢复
- 支持查看 / 删除 / 暂停 / 恢复任务
- 仅超级用户私聊可用，防止群员滥用

## 安装

### 使用 nb-cli 安装

```bash
nb plugin install nonebot-plugin-scheduled-message
```

### 使用 pip 安装

```bash
pip install nonebot-plugin-scheduled-message
```

### 使用 poetry 安装

```bash
poetry add nonebot-plugin-scheduled-message
```

## 配置

在 NoneBot 项目的 `.env` 文件中添加（可选）：

```env
# 允许设置的最小定时间隔（分钟），默认 5
SCHEDULED_MESSAGE_MIN_INTERVAL=5
```

同时确保 `.env` 中配置了 `SUPERUSERS`，例如：

```env
SUPERUSERS=["123456789"]
```

## 使用方法

### 私聊（仅超级用户，可管理任意群）

| 指令 | 说明 |
|---|---|
| /定时发消息 <群号> <间隔分钟> | 添加定时任务，随后发送的消息即为内容 |
| /定时消息列表 | 查看所有定时任务 |
| /删除定时消息 <id> | 删除任务 |
| /暂停定时消息 <id> | 暂停任务 |
| /恢复定时消息 <id> | 恢复任务 |

### 群聊（群主/管理员/超级用户，仅管理本群）

| 指令 | 说明 |
|---|---|
| /定时发消息 <间隔分钟> | 添加本群定时任务，随后发送的消息即为内容 |
| /定时发消息 <群号> <间隔分钟> | （仅超级用户）在群内为指定群添加定时任务 |
| /定时消息列表 | 查看本群定时任务 |
| /删除定时消息 <id> | 删除本群任务 |
| /暂停定时消息 <id> | 暂停本群任务 |
| /恢复定时消息 <id> | 恢复本群任务 |

## 示例

```text
你：/定时发消息 123456 30
机器人：请发送要定时发送的消息内容（支持多行，回复"取消"可取消）
你：大家好，这是每 30 分钟一次的定时消息～
机器人：已添加定时任务 #1：群 123456，每 30 分钟发送一次
```

## 许可证

MIT
