nonebot-plugin-maimaimonitor 26.2.2__tar.gz → 26.2.4__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_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/PKG-INFO +1 -1
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/README.md +2 -3
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/nonebot_plugin_maimaimonitor/maimai_plugin_v11.py +13 -19
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/nonebot_plugin_maimaimonitor.egg-info/PKG-INFO +1 -1
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/pyproject.toml +1 -1
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/LICENSE +0 -0
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/nonebot_plugin_maimaimonitor/__init__.py +0 -0
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/nonebot_plugin_maimaimonitor/client.py +0 -0
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/nonebot_plugin_maimaimonitor/config.py +0 -0
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/nonebot_plugin_maimaimonitor/constants.py +0 -0
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/nonebot_plugin_maimaimonitor.egg-info/SOURCES.txt +0 -0
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/nonebot_plugin_maimaimonitor.egg-info/dependency_links.txt +0 -0
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/nonebot_plugin_maimaimonitor.egg-info/requires.txt +0 -0
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/nonebot_plugin_maimaimonitor.egg-info/top_level.txt +0 -0
- {nonebot_plugin_maimaimonitor-26.2.2 → nonebot_plugin_maimaimonitor-26.2.4}/setup.cfg +0 -0
|
@@ -48,7 +48,7 @@ pip install nonebot-plugin-maimaimonitor
|
|
|
48
48
|
| `MAIMAI_BROADCAST_INTERVAL` | `int` | `300` | 广播轮询检测间隔(秒)|
|
|
49
49
|
| `MAIMAI_BROADCAST_ALL_GROUPS` | `bool` | `false` | 向bot所在所有群播报,谨慎使用 |
|
|
50
50
|
| `MAIMAI_BROADCAST_TIME_RANGES` | `str` | 无 | 推送时间白名单,格式如 `8-11,13-20`,空时不限制。左闭右开(`8-11` 包含 8 点不包含 11 点),跨天用 `22-6`(晚上 10 点到早上 6 点)|
|
|
51
|
-
| `MAIMAI_BROADCAST_SERVERS` | `list[str]` | `[]` | 要播报的服务器列表,可填 key 或名字(如 `["net","aime"]
|
|
51
|
+
| `MAIMAI_BROADCAST_SERVERS` | `list[str]` | `[]` | 要播报的服务器列表,可填 key 或名字(如 `["net","aime"]`)。留空默认全部服务(NET/会员/标题/公众号)都播报宕机提示 |
|
|
52
52
|
|
|
53
53
|
> **申请 Client ID**:Client ID 由您自行提供,任意 ASCII 字符串,联系 qwq@chongxi.us 或 chongxi3555@proton.me 获取对应私钥。
|
|
54
54
|
|
|
@@ -66,7 +66,6 @@ pip install nonebot-plugin-maimaimonitor
|
|
|
66
66
|
🟢 会员 38ms
|
|
67
67
|
🟢 标题 45ms
|
|
68
68
|
🟢 公众号 51ms
|
|
69
|
-
🟢 配信 40ms
|
|
70
69
|
|
|
71
70
|
⏱ 当前延迟:42ms|服务器负载:流畅|延迟稳定
|
|
72
71
|
💬 服务器运行正常
|
|
@@ -101,7 +100,7 @@ pip install nonebot-plugin-maimaimonitor
|
|
|
101
100
|
- 返航(正常):「华立冯返航了」「SEGA老冯落地」
|
|
102
101
|
|
|
103
102
|
### 断网播报 (无需私钥)
|
|
104
|
-
配置 `MAIMAI_BROADCAST_GROUP_IDS` 或开启 `MAIMAI_BROADCAST_ALL_GROUPS`
|
|
103
|
+
配置 `MAIMAI_BROADCAST_GROUP_IDS` 或开启 `MAIMAI_BROADCAST_ALL_GROUPS` 后,服务器宕机时自动推送(默认全部服务的宕机都会播报,可用 `MAIMAI_BROADCAST_SERVERS` 限定播报范围):
|
|
105
104
|
|
|
106
105
|
```
|
|
107
106
|
【舞萌DX服务器断网播报】
|
|
@@ -59,23 +59,17 @@ def _resolve_verdict(data: dict) -> str:
|
|
|
59
59
|
return LEGACY_STATUS_TO_VERDICT.get(data.get("status", "normal"), "normal")
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
def _is_delivery(s: dict) -> bool:
|
|
63
|
-
key = str(s.get("key", "")).lower()
|
|
64
|
-
name = str(s.get("name", "")).lower()
|
|
65
|
-
return key == "haisin" or (not key and name == "配信")
|
|
66
|
-
|
|
67
|
-
|
|
68
62
|
def _broadcast_eligible(services) -> list[dict]:
|
|
69
63
|
cfg = {str(x).lower() for x in config.maimai_broadcast_servers}
|
|
70
|
-
if cfg:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return
|
|
64
|
+
if not cfg:
|
|
65
|
+
return list(services or [])
|
|
66
|
+
out = []
|
|
67
|
+
for s in services or []:
|
|
68
|
+
candidates = {str(s.get("key", "")).lower(), str(s.get("name", "")).lower()}
|
|
69
|
+
candidates.discard("")
|
|
70
|
+
if candidates & cfg:
|
|
71
|
+
out.append(s)
|
|
72
|
+
return out
|
|
79
73
|
|
|
80
74
|
|
|
81
75
|
def _render_services(services) -> list[str]:
|
|
@@ -119,7 +113,7 @@ async def handle_net(matcher: Matcher):
|
|
|
119
113
|
data = await reporter.fetch_status()
|
|
120
114
|
if not data:
|
|
121
115
|
await matcher.finish(
|
|
122
|
-
"获取服务器状态失败,请稍后重试\n
|
|
116
|
+
"获取服务器状态失败,请稍后重试\n📡 数据来源:华立服务器死了吗 by Chongxi"
|
|
123
117
|
)
|
|
124
118
|
return
|
|
125
119
|
|
|
@@ -158,7 +152,7 @@ async def handle_net(matcher: Matcher):
|
|
|
158
152
|
if broadcast and broadcast.get("msg"):
|
|
159
153
|
msg += f"\n📢 {broadcast['msg']}\n"
|
|
160
154
|
|
|
161
|
-
msg += "\n
|
|
155
|
+
msg += "\n📡 数据来源:华立服务器死了吗 by Chongxi"
|
|
162
156
|
|
|
163
157
|
await matcher.finish(msg)
|
|
164
158
|
|
|
@@ -267,7 +261,7 @@ async def check_server_status():
|
|
|
267
261
|
msg = "【舞萌DX服务器状态恢复】\n"
|
|
268
262
|
msg += f"{VERDICT_MAP.get(cur, '❓ 未知')}\n"
|
|
269
263
|
msg += f"本次约持续 {format_duration(duration)}\n\n"
|
|
270
|
-
msg += "
|
|
264
|
+
msg += "\n📡 数据来源:华立服务器死了吗 by Chongxi"
|
|
271
265
|
logger.info(f"服务器恢复正常,播报恢复通知")
|
|
272
266
|
await broadcast_to_groups(msg)
|
|
273
267
|
return
|
|
@@ -288,7 +282,7 @@ async def check_server_status():
|
|
|
288
282
|
msg += f"\n💬 {summary}\n"
|
|
289
283
|
for log in logs[:3]:
|
|
290
284
|
msg += f"• {log.get('time_ago', '--')} {log.get('region', '--')} {log.get('type', '--')}\n"
|
|
291
|
-
msg += "\n
|
|
285
|
+
msg += "\n📡 数据来源:华立服务器死了吗 by Chongxi"
|
|
292
286
|
logger.info(f"检测到服务器宕机,开始播报")
|
|
293
287
|
await broadcast_to_groups(msg)
|
|
294
288
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|