nonebot-plugin-aawarframe 0.3.2__tar.gz → 0.4.1__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_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/PKG-INFO +11 -9
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/README.md +10 -8
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/templates/current_arbys.html +1 -1
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/templates/eidolon_clock.html +32 -33
- nonebot_plugin_aawarframe-0.4.1/nonebot_plugin_aawarframe/assets/templates/s_arbys.html +193 -0
- nonebot_plugin_aawarframe-0.4.1/nonebot_plugin_aawarframe/assets/templates/void_fissures.html +242 -0
- nonebot_plugin_aawarframe-0.4.1/nonebot_plugin_aawarframe/commands.py +60 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/common/browser_manager.py +8 -3
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/service/arbys/__init__.py +37 -10
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/service/archimedea/deep.py +1 -1
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/service/archimedea/temporal.py +1 -1
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/service/earth/__init__.py +1 -1
- nonebot_plugin_aawarframe-0.4.1/nonebot_plugin_aawarframe/service/voidfissures/__init__.py +71 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe.egg-info/PKG-INFO +11 -9
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe.egg-info/SOURCES.txt +4 -2
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/pyproject.toml +1 -1
- nonebot_plugin_aawarframe-0.3.2/nonebot_plugin_aawarframe/commands.py +0 -37
- nonebot_plugin_aawarframe-0.3.2/nonebot_plugin_aawarframe/service/archimedea/__init__.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/LICENSE +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/__init__.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/ExportRegions_zh.json +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/conquest_zh.json +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/faction_type.json +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/final_arbys.json +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/mission_type.json +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/templates/archimedea.html +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/templates/today_arbys.html +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/variables.json +0 -0
- /nonebot_plugin_aawarframe-0.3.2/nonebot_plugin_aawarframe/common/data_fetcher.py → /nonebot_plugin_aawarframe-0.4.1/nonebot_plugin_aawarframe/common/__init__.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2/nonebot_plugin_aawarframe/common → nonebot_plugin_aawarframe-0.4.1/nonebot_plugin_aawarframe/service}/__init__.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2/nonebot_plugin_aawarframe/service → nonebot_plugin_aawarframe-0.4.1/nonebot_plugin_aawarframe/service/archimedea}/__init__.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/service/archimedea/data_processor.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe.egg-info/dependency_links.txt +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe.egg-info/requires.txt +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe.egg-info/top_level.txt +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.4.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nonebot-plugin-aawarframe
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: aa 的 Warframe 助手
|
|
5
5
|
Author-email: nekox41 <aameow@outlook.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -48,8 +48,8 @@ _✨ Aa 的 Warframe 助手,用于查询游戏状态。 ✨_
|
|
|
48
48
|
- [x] 深层科研
|
|
49
49
|
- [ ] 查询仲裁任务
|
|
50
50
|
- [x] 当前仲裁任务与下一次仲裁
|
|
51
|
-
- [
|
|
52
|
-
- [
|
|
51
|
+
- [x] 今日所有仲裁
|
|
52
|
+
- [x] 未来 5 个 S 级仲裁时间
|
|
53
53
|
- [ ] Warframe Market 商品信息查询
|
|
54
54
|
|
|
55
55
|
## 💿 安装
|
|
@@ -95,12 +95,14 @@ _✨ Aa 的 Warframe 助手,用于查询游戏状态。 ✨_
|
|
|
95
95
|
|
|
96
96
|
## 🎉 使用
|
|
97
97
|
### 指令表
|
|
98
|
-
| 指令 | 权限 | 需要@ | 范围 |
|
|
99
|
-
|
|
100
|
-
| 夜灵平原 | 所有人 | 否 | 群聊 |
|
|
101
|
-
| 时光科研 | 所有人 | 否 | 群聊 |
|
|
102
|
-
| 深层科研 | 所有人 | 否 | 群聊 |
|
|
103
|
-
| 仲裁 | 所有人 | 否 | 群聊 |
|
|
98
|
+
| 指令 | 权限 | 需要@ | 范围 | 说明 |
|
|
99
|
+
|:----:|:---:|:---:|:--:|:----------------:|
|
|
100
|
+
| 夜灵平原 | 所有人 | 否 | 群聊 | 返回夜灵平原时间 |
|
|
101
|
+
| 时光科研 | 所有人 | 否 | 群聊 | 返回本周时光科研 |
|
|
102
|
+
| 深层科研 | 所有人 | 否 | 群聊 | 返回本周深层科研 |
|
|
103
|
+
| 仲裁 | 所有人 | 否 | 群聊 | 返回当前仲裁和下一次仲裁 |
|
|
104
|
+
| 今日仲裁 | 所有人 | 否 | 群聊 | 返回今日所有仲裁 |
|
|
105
|
+
| 高效仲裁 | 所有人 | 否 | 群聊 | 返回 5 个接下来的 S 级仲裁 |
|
|
104
106
|
### 效果图
|
|
105
107
|
<p><img src="https://github.com/nekox41/nonebot-plugin-aawarframe/blob/master/imgs/example1.png" alt="效果图1"></p>
|
|
106
108
|
<p><img src="https://github.com/nekox41/nonebot-plugin-aawarframe/blob/master/imgs/example2.png" alt="效果图2"></p>
|
|
@@ -32,8 +32,8 @@ _✨ Aa 的 Warframe 助手,用于查询游戏状态。 ✨_
|
|
|
32
32
|
- [x] 深层科研
|
|
33
33
|
- [ ] 查询仲裁任务
|
|
34
34
|
- [x] 当前仲裁任务与下一次仲裁
|
|
35
|
-
- [
|
|
36
|
-
- [
|
|
35
|
+
- [x] 今日所有仲裁
|
|
36
|
+
- [x] 未来 5 个 S 级仲裁时间
|
|
37
37
|
- [ ] Warframe Market 商品信息查询
|
|
38
38
|
|
|
39
39
|
## 💿 安装
|
|
@@ -79,12 +79,14 @@ _✨ Aa 的 Warframe 助手,用于查询游戏状态。 ✨_
|
|
|
79
79
|
|
|
80
80
|
## 🎉 使用
|
|
81
81
|
### 指令表
|
|
82
|
-
| 指令 | 权限 | 需要@ | 范围 |
|
|
83
|
-
|
|
84
|
-
| 夜灵平原 | 所有人 | 否 | 群聊 |
|
|
85
|
-
| 时光科研 | 所有人 | 否 | 群聊 |
|
|
86
|
-
| 深层科研 | 所有人 | 否 | 群聊 |
|
|
87
|
-
| 仲裁 | 所有人 | 否 | 群聊 |
|
|
82
|
+
| 指令 | 权限 | 需要@ | 范围 | 说明 |
|
|
83
|
+
|:----:|:---:|:---:|:--:|:----------------:|
|
|
84
|
+
| 夜灵平原 | 所有人 | 否 | 群聊 | 返回夜灵平原时间 |
|
|
85
|
+
| 时光科研 | 所有人 | 否 | 群聊 | 返回本周时光科研 |
|
|
86
|
+
| 深层科研 | 所有人 | 否 | 群聊 | 返回本周深层科研 |
|
|
87
|
+
| 仲裁 | 所有人 | 否 | 群聊 | 返回当前仲裁和下一次仲裁 |
|
|
88
|
+
| 今日仲裁 | 所有人 | 否 | 群聊 | 返回今日所有仲裁 |
|
|
89
|
+
| 高效仲裁 | 所有人 | 否 | 群聊 | 返回 5 个接下来的 S 级仲裁 |
|
|
88
90
|
### 效果图
|
|
89
91
|
<p><img src="https://github.com/nekox41/nonebot-plugin-aawarframe/blob/master/imgs/example1.png" alt="效果图1"></p>
|
|
90
92
|
<p><img src="https://github.com/nekox41/nonebot-plugin-aawarframe/blob/master/imgs/example2.png" alt="效果图2"></p>
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
body {
|
|
7
7
|
margin: 0;
|
|
8
8
|
padding: 0;
|
|
9
|
-
width:
|
|
10
|
-
height: 1200px;
|
|
9
|
+
width: 800px;
|
|
11
10
|
background: linear-gradient(135deg, #fff0f5, #ffe4f0, #f8e1f0);
|
|
12
11
|
display: flex;
|
|
13
12
|
justify-content: center;
|
|
@@ -16,6 +15,7 @@
|
|
|
16
15
|
"Noto Sans CJK SC", "Hiragino Sans GB", "WenQuanYi Micro Hei", sans-serif;
|
|
17
16
|
position: relative;
|
|
18
17
|
overflow: hidden;
|
|
18
|
+
min-height: 100vh;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/* 大量静态樱花花瓣装饰 */
|
|
@@ -50,16 +50,15 @@
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.container {
|
|
53
|
-
width:
|
|
54
|
-
max-height: 1080px;
|
|
53
|
+
width: 90%; /* 铺满 body 的 90% */
|
|
55
54
|
background: linear-gradient(145deg, #fff5f8, #ffe9f0, #ffe0eb);
|
|
56
|
-
border-radius:
|
|
55
|
+
border-radius: 40px;
|
|
57
56
|
overflow: hidden;
|
|
58
57
|
box-shadow:
|
|
59
|
-
0
|
|
60
|
-
0 0 0 1px rgba(255, 182, 193, 0.
|
|
61
|
-
0
|
|
62
|
-
border:
|
|
58
|
+
0 30px 70px -15px rgba(255, 105, 180, 0.4),
|
|
59
|
+
0 0 0 1px rgba(255, 182, 193, 0.5) inset,
|
|
60
|
+
0 15px 40px rgba(255, 140, 170, 0.25);
|
|
61
|
+
border: 3px solid rgba(255, 182, 193, 0.65);
|
|
63
62
|
position: relative;
|
|
64
63
|
z-index: 1;
|
|
65
64
|
}
|
|
@@ -71,7 +70,7 @@
|
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
td, th {
|
|
74
|
-
padding:
|
|
73
|
+
padding: 22px 30px;
|
|
75
74
|
text-align: center;
|
|
76
75
|
border: none;
|
|
77
76
|
}
|
|
@@ -79,51 +78,51 @@
|
|
|
79
78
|
/* 当前状态 */
|
|
80
79
|
.state {
|
|
81
80
|
background: linear-gradient(to right, #ffb3c6, #ff8fab);
|
|
82
|
-
font-size: 1.
|
|
81
|
+
font-size: 1.65rem;
|
|
83
82
|
font-weight: 600;
|
|
84
83
|
color: #5c2a3a;
|
|
85
|
-
letter-spacing: 2.
|
|
86
|
-
padding:
|
|
84
|
+
letter-spacing: 2.5px;
|
|
85
|
+
padding: 28px 30px;
|
|
87
86
|
border-bottom: 1px solid rgba(255, 255, 255, 0.8);
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
/* 剩余时间 */
|
|
91
90
|
.rest {
|
|
92
91
|
background: linear-gradient(to right, #ffe4f0, #ffd1e6);
|
|
93
|
-
font-size: 2.
|
|
92
|
+
font-size: 2.35rem;
|
|
94
93
|
font-weight: 600;
|
|
95
94
|
color: #d14a7e;
|
|
96
|
-
padding:
|
|
97
|
-
letter-spacing:
|
|
98
|
-
text-shadow: 0 3px
|
|
95
|
+
padding: 34px 30px;
|
|
96
|
+
letter-spacing: 1px;
|
|
97
|
+
text-shadow: 0 3px 15px rgba(255, 105, 180, 0.4);
|
|
99
98
|
border-bottom: 1px solid rgba(255, 255, 255, 0.75);
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
/* 标题 */
|
|
103
102
|
.title {
|
|
104
103
|
background: #fff0f7;
|
|
105
|
-
font-size: 1.
|
|
104
|
+
font-size: 1.2rem;
|
|
106
105
|
font-weight: 600;
|
|
107
106
|
color: #e06a9a;
|
|
108
|
-
letter-spacing:
|
|
109
|
-
padding:
|
|
107
|
+
letter-spacing: 4px;
|
|
108
|
+
padding: 18px 30px 16px;
|
|
110
109
|
border-bottom: 1px solid rgba(255, 182, 193, 0.45);
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
/* 时间行 */
|
|
114
113
|
.time {
|
|
115
114
|
background: rgba(255, 245, 250, 0.93);
|
|
116
|
-
font-size:
|
|
115
|
+
font-size: 1.9rem;
|
|
117
116
|
font-family: ui-monospace, "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
|
|
118
117
|
font-weight: 500;
|
|
119
118
|
color: #c05a8a;
|
|
120
|
-
padding:
|
|
121
|
-
letter-spacing:
|
|
119
|
+
padding: 22px 30px;
|
|
120
|
+
letter-spacing: 5px;
|
|
122
121
|
}
|
|
123
122
|
|
|
124
123
|
tr:last-child .time {
|
|
125
|
-
border-bottom-left-radius:
|
|
126
|
-
border-bottom-right-radius:
|
|
124
|
+
border-bottom-left-radius: 36px;
|
|
125
|
+
border-bottom-right-radius: 36px;
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
/* 分隔线 */
|
|
@@ -135,20 +134,20 @@
|
|
|
135
134
|
.container::before {
|
|
136
135
|
content: '🌸';
|
|
137
136
|
position: absolute;
|
|
138
|
-
font-size:
|
|
139
|
-
opacity: 0.
|
|
140
|
-
top:
|
|
141
|
-
left:
|
|
137
|
+
font-size: 48px;
|
|
138
|
+
opacity: 0.12;
|
|
139
|
+
top: 40px;
|
|
140
|
+
left: 40px;
|
|
142
141
|
z-index: 0;
|
|
143
142
|
}
|
|
144
143
|
|
|
145
144
|
.container::after {
|
|
146
145
|
content: '🌸';
|
|
147
146
|
position: absolute;
|
|
148
|
-
font-size:
|
|
149
|
-
opacity: 0.
|
|
150
|
-
top:
|
|
151
|
-
right:
|
|
147
|
+
font-size: 64px;
|
|
148
|
+
opacity: 0.1;
|
|
149
|
+
top: 100px;
|
|
150
|
+
right: 40px;
|
|
152
151
|
z-index: 0;
|
|
153
152
|
}
|
|
154
153
|
</style>
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>即将到来的 S 级任务 · 樱花</title>
|
|
7
|
+
<style>
|
|
8
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
9
|
+
|
|
10
|
+
body {
|
|
11
|
+
font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
|
|
12
|
+
background: linear-gradient(135deg, #fff0f5, #ffe4f0, #f8e1f0);
|
|
13
|
+
color: #5c2a3a;
|
|
14
|
+
min-height: 100vh;
|
|
15
|
+
padding: 40px 20px;
|
|
16
|
+
position: relative;
|
|
17
|
+
overflow-x: hidden;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
body::before {
|
|
21
|
+
content: '';
|
|
22
|
+
position: fixed;
|
|
23
|
+
inset: 0;
|
|
24
|
+
background:
|
|
25
|
+
radial-gradient(circle at 20% 25%, rgba(255, 182, 193, 0.28) 0%, transparent 50%),
|
|
26
|
+
radial-gradient(circle at 75% 35%, rgba(255, 120, 160, 0.22) 0%, transparent 48%),
|
|
27
|
+
radial-gradient(circle at 40% 80%, rgba(255, 200, 220, 0.25) 0%, transparent 45%);
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
z-index: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.container {
|
|
33
|
+
max-width: 980px;
|
|
34
|
+
margin: 0 auto;
|
|
35
|
+
position: relative;
|
|
36
|
+
z-index: 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.header {
|
|
40
|
+
text-align: center;
|
|
41
|
+
margin-bottom: 40px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.header h1 {
|
|
45
|
+
font-size: 2.4rem;
|
|
46
|
+
color: #e06a9a;
|
|
47
|
+
margin-bottom: 8px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.header p {
|
|
51
|
+
color: #c05a8a;
|
|
52
|
+
font-size: 1.15rem;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.task-list {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
gap: 18px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.task-item {
|
|
62
|
+
background: rgba(255, 245, 250, 0.96);
|
|
63
|
+
border: 3px solid #ff8fab;
|
|
64
|
+
border-radius: 22px;
|
|
65
|
+
padding: 22px 28px;
|
|
66
|
+
box-shadow: 0 18px 45px rgba(255, 105, 180, 0.25);
|
|
67
|
+
position: relative;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.task-item::before {
|
|
72
|
+
content: "🌸";
|
|
73
|
+
position: absolute;
|
|
74
|
+
font-size: 48px;
|
|
75
|
+
opacity: 0.12;
|
|
76
|
+
top: 20px;
|
|
77
|
+
right: 28px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.task-header {
|
|
81
|
+
display: flex;
|
|
82
|
+
justify-content: space-between;
|
|
83
|
+
align-items: flex-start;
|
|
84
|
+
margin-bottom: 16px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.name {
|
|
88
|
+
font-size: 1.75rem;
|
|
89
|
+
font-weight: 600;
|
|
90
|
+
color: #5c2a3a;
|
|
91
|
+
flex: 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.tier {
|
|
95
|
+
background: linear-gradient(90deg, #ffd1e6, #ff9eb5);
|
|
96
|
+
color: #d14a7e;
|
|
97
|
+
font-size: 1.45rem;
|
|
98
|
+
font-weight: 700;
|
|
99
|
+
padding: 6px 20px;
|
|
100
|
+
border-radius: 30px;
|
|
101
|
+
box-shadow: 0 0 12px rgba(255, 105, 180, 0.4);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.info {
|
|
105
|
+
display: grid;
|
|
106
|
+
grid-template-columns: 1fr 1fr;
|
|
107
|
+
gap: 16px;
|
|
108
|
+
font-size: 1.05rem;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.info-item {
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.label {
|
|
117
|
+
color: #c05a8a;
|
|
118
|
+
font-size: 0.9rem;
|
|
119
|
+
font-weight: 500;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.time {
|
|
123
|
+
font-size: 1.15rem;
|
|
124
|
+
color: #d14a7e;
|
|
125
|
+
font-weight: 500;
|
|
126
|
+
margin-top: 4px;
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
129
|
+
</head>
|
|
130
|
+
<body>
|
|
131
|
+
<div class="container">
|
|
132
|
+
<div class="header">
|
|
133
|
+
<h1>✦ 即将到来的 S 级任务 ✦</h1>
|
|
134
|
+
<p>5个即将到来的 S 级仲裁</p>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
<div class="task-list" id="task-list">
|
|
138
|
+
<!-- JS 动态生成 -->
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<script>
|
|
143
|
+
const data = {{DATA}};
|
|
144
|
+
|
|
145
|
+
function formatDateTime(timestamp) {
|
|
146
|
+
const date = new Date(timestamp * 1000);
|
|
147
|
+
return date.toLocaleString('zh-CN', {
|
|
148
|
+
month: 'short',
|
|
149
|
+
day: 'numeric',
|
|
150
|
+
hour: '2-digit',
|
|
151
|
+
minute: '2-digit'
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function renderTasks() {
|
|
156
|
+
const container = document.getElementById('task-list');
|
|
157
|
+
container.innerHTML = '';
|
|
158
|
+
|
|
159
|
+
data.forEach(task => {
|
|
160
|
+
const div = document.createElement('div');
|
|
161
|
+
div.className = 'task-item';
|
|
162
|
+
div.innerHTML = `
|
|
163
|
+
<div class="task-header">
|
|
164
|
+
<div class="name">${task.name}</div>
|
|
165
|
+
<div class="tier">S</div>
|
|
166
|
+
</div>
|
|
167
|
+
<div class="info">
|
|
168
|
+
<div class="info-item">
|
|
169
|
+
<span class="label">星球</span>
|
|
170
|
+
<span>${task.map}</span>
|
|
171
|
+
</div>
|
|
172
|
+
<div class="info-item">
|
|
173
|
+
<span class="label">类型</span>
|
|
174
|
+
<span>${task.type}</span>
|
|
175
|
+
</div>
|
|
176
|
+
<div class="info-item">
|
|
177
|
+
<span class="label">派系</span>
|
|
178
|
+
<span>${task.faction}</span>
|
|
179
|
+
</div>
|
|
180
|
+
<div class="info-item">
|
|
181
|
+
<span class="label">开始时间</span>
|
|
182
|
+
<span class="time">${formatDateTime(task.start)}</span>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
`;
|
|
186
|
+
container.appendChild(div);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
window.onload = renderTasks;
|
|
191
|
+
</script>
|
|
192
|
+
</body>
|
|
193
|
+
</html>
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>普通裂缝 · 樱花</title>
|
|
7
|
+
<style>
|
|
8
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
9
|
+
|
|
10
|
+
body {
|
|
11
|
+
width: 800px;
|
|
12
|
+
margin: 0 auto;
|
|
13
|
+
font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
|
|
14
|
+
background: linear-gradient(135deg, #fff0f5, #ffe4f0, #f8e1f0);
|
|
15
|
+
color: #5c2a3a;
|
|
16
|
+
padding: 28px 0 32px;
|
|
17
|
+
position: relative;
|
|
18
|
+
overflow-x: hidden;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
body::before {
|
|
22
|
+
content: '';
|
|
23
|
+
position: absolute;
|
|
24
|
+
inset: 0;
|
|
25
|
+
background:
|
|
26
|
+
radial-gradient(circle at 20% 25%, rgba(255, 182, 193, 0.25) 0%, transparent 50%),
|
|
27
|
+
radial-gradient(circle at 75% 35%, rgba(255, 120, 160, 0.2) 0%, transparent 48%),
|
|
28
|
+
radial-gradient(circle at 40% 80%, rgba(255, 200, 220, 0.22) 0%, transparent 45%);
|
|
29
|
+
pointer-events: none;
|
|
30
|
+
z-index: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.container {
|
|
34
|
+
width: 90%;
|
|
35
|
+
margin: 0 auto;
|
|
36
|
+
position: relative;
|
|
37
|
+
z-index: 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.header {
|
|
41
|
+
text-align: center;
|
|
42
|
+
margin-bottom: 26px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.header h1 {
|
|
46
|
+
font-size: 2.3rem;
|
|
47
|
+
color: #e06a9a;
|
|
48
|
+
letter-spacing: 2px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.group {
|
|
52
|
+
margin-bottom: 24px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.group-title {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: 12px;
|
|
59
|
+
margin-bottom: 12px;
|
|
60
|
+
padding-left: 2px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.group-title .modifier {
|
|
64
|
+
background: linear-gradient(90deg, #ffd1e6, #ff9eb5);
|
|
65
|
+
color: #d14a7e;
|
|
66
|
+
font-size: 1.15rem;
|
|
67
|
+
font-weight: 700;
|
|
68
|
+
padding: 5px 16px;
|
|
69
|
+
border-radius: 9999px;
|
|
70
|
+
box-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.group-title .count {
|
|
74
|
+
font-size: 0.92rem;
|
|
75
|
+
color: #c05a8a;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.task-list {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
gap: 9px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.task-item {
|
|
85
|
+
background: rgba(255, 245, 250, 0.97);
|
|
86
|
+
border: 2px solid #ffb3c6;
|
|
87
|
+
border-radius: 15px;
|
|
88
|
+
padding: 12px 16px;
|
|
89
|
+
box-shadow: 0 5px 18px rgba(255, 140, 170, 0.14);
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
gap: 12px;
|
|
93
|
+
position: relative;
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.task-item::before {
|
|
98
|
+
content: "🌸";
|
|
99
|
+
position: absolute;
|
|
100
|
+
font-size: 32px;
|
|
101
|
+
opacity: 0.07;
|
|
102
|
+
top: 6px;
|
|
103
|
+
right: 12px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.left {
|
|
107
|
+
width: 145px;
|
|
108
|
+
flex-shrink: 0;
|
|
109
|
+
position: relative;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.region {
|
|
113
|
+
font-size: 1.18rem;
|
|
114
|
+
font-weight: 600;
|
|
115
|
+
color: #5c2a3a;
|
|
116
|
+
line-height: 1.2;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.name {
|
|
120
|
+
font-size: 0.95rem;
|
|
121
|
+
color: #c05a8a;
|
|
122
|
+
margin-top: 2px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.faction {
|
|
126
|
+
position: absolute;
|
|
127
|
+
top: -3px;
|
|
128
|
+
right: 0;
|
|
129
|
+
background: #ffe4f0;
|
|
130
|
+
color: #d14a7e;
|
|
131
|
+
font-size: 0.7rem;
|
|
132
|
+
font-weight: 600;
|
|
133
|
+
padding: 2px 8px;
|
|
134
|
+
border-radius: 9999px;
|
|
135
|
+
border: 1px solid #ffb3c6;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.type {
|
|
139
|
+
flex: 1;
|
|
140
|
+
font-size: 1.28rem;
|
|
141
|
+
font-weight: 700;
|
|
142
|
+
color: #e06a9a;
|
|
143
|
+
text-align: center;
|
|
144
|
+
letter-spacing: 1px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.right {
|
|
148
|
+
width: 125px;
|
|
149
|
+
flex-shrink: 0;
|
|
150
|
+
text-align: right;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.remain {
|
|
154
|
+
font-size: 0.92rem;
|
|
155
|
+
color: #b36a7f;
|
|
156
|
+
font-weight: 500;
|
|
157
|
+
white-space: nowrap;
|
|
158
|
+
font-variant-numeric: tabular-nums;
|
|
159
|
+
}
|
|
160
|
+
</style>
|
|
161
|
+
</head>
|
|
162
|
+
<body>
|
|
163
|
+
<div class="container">
|
|
164
|
+
<div class="header">
|
|
165
|
+
<h1>✦ {{TITLE}} ✦</h1>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<div id="groups">
|
|
169
|
+
<!-- JS 动态生成 -->
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<script>
|
|
174
|
+
const data = {{DATA}};
|
|
175
|
+
|
|
176
|
+
const order = ["古纪", "前纪", "中纪", "后纪", "安魂", "全能"];
|
|
177
|
+
|
|
178
|
+
function getRemaining(endMs) {
|
|
179
|
+
const diff = Number(endMs) - Date.now();
|
|
180
|
+
if (diff <= 0) return "已结束";
|
|
181
|
+
|
|
182
|
+
const totalSeconds = Math.floor(diff / 1000);
|
|
183
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
184
|
+
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
|
185
|
+
const seconds = totalSeconds % 60;
|
|
186
|
+
|
|
187
|
+
if (hours > 0) {
|
|
188
|
+
return `${hours}小时${minutes}分${seconds.toString().padStart(2, '0')}秒`;
|
|
189
|
+
} else {
|
|
190
|
+
return `${minutes}分${seconds.toString().padStart(2, '0')}秒`;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function render() {
|
|
195
|
+
const groups = {};
|
|
196
|
+
data.forEach(task => {
|
|
197
|
+
if (!groups[task.modifier]) groups[task.modifier] = [];
|
|
198
|
+
groups[task.modifier].push(task);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
const sortedKeys = Object.keys(groups).sort((a, b) => {
|
|
202
|
+
return (order.indexOf(a) === -1 ? 99 : order.indexOf(a)) -
|
|
203
|
+
(order.indexOf(b) === -1 ? 99 : order.indexOf(b));
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
const container = document.getElementById('groups');
|
|
207
|
+
container.innerHTML = '';
|
|
208
|
+
|
|
209
|
+
sortedKeys.forEach(mod => {
|
|
210
|
+
const tasks = groups[mod];
|
|
211
|
+
const groupDiv = document.createElement('div');
|
|
212
|
+
groupDiv.className = 'group';
|
|
213
|
+
|
|
214
|
+
groupDiv.innerHTML = `
|
|
215
|
+
<div class="group-title">
|
|
216
|
+
<div class="modifier">${mod}</div>
|
|
217
|
+
<div class="count">${tasks.length} 个任务</div>
|
|
218
|
+
</div>
|
|
219
|
+
<div class="task-list">
|
|
220
|
+
${tasks.map(task => `
|
|
221
|
+
<div class="task-item">
|
|
222
|
+
<div class="left">
|
|
223
|
+
<div class="faction">${task.faction}</div>
|
|
224
|
+
<div class="region">${task.region}</div>
|
|
225
|
+
<div class="name">${task.name}</div>
|
|
226
|
+
</div>
|
|
227
|
+
<div class="type">${task.type}</div>
|
|
228
|
+
<div class="right">
|
|
229
|
+
<div class="remain">${getRemaining(task.end)}</div>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
`).join('')}
|
|
233
|
+
</div>
|
|
234
|
+
`;
|
|
235
|
+
container.appendChild(groupDiv);
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
window.onload = render;
|
|
240
|
+
</script>
|
|
241
|
+
</body>
|
|
242
|
+
</html>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
from nonebot import on_command
|
|
2
|
+
from .service.archimedea.deep import gen_deep_img
|
|
3
|
+
from .service.archimedea.temporal import gen_temporal_img
|
|
4
|
+
from .service.earth import gen_eidolon_img
|
|
5
|
+
from .service.arbys import gen_current_arbys_img, gen_today_arbys_img, gen_s_arbys_img
|
|
6
|
+
from .service.voidfissures import gen_void_fissures_img
|
|
7
|
+
from nonebot.adapters.onebot.v11 import MessageEvent, MessageSegment, Message
|
|
8
|
+
# 夜灵平原
|
|
9
|
+
cetus = on_command("夜灵平原")
|
|
10
|
+
|
|
11
|
+
@cetus.handle()
|
|
12
|
+
async def cetus_handle():
|
|
13
|
+
await cetus.finish(await gen_eidolon_img())
|
|
14
|
+
|
|
15
|
+
# ----- Archimedea -----
|
|
16
|
+
temporal = on_command("时光科研")
|
|
17
|
+
@temporal.handle()
|
|
18
|
+
async def temporal_handle():
|
|
19
|
+
await temporal.finish(await gen_temporal_img())
|
|
20
|
+
|
|
21
|
+
# 深层科研
|
|
22
|
+
deep = on_command("深层科研")
|
|
23
|
+
@deep.handle()
|
|
24
|
+
async def deep_handle():
|
|
25
|
+
await deep.finish(await gen_deep_img())
|
|
26
|
+
# ----------------------
|
|
27
|
+
|
|
28
|
+
# -------- Arbitration ---------------
|
|
29
|
+
current_arbys = on_command("仲裁")
|
|
30
|
+
@current_arbys.handle()
|
|
31
|
+
async def current_arbys_handle():
|
|
32
|
+
await current_arbys.finish(await gen_current_arbys_img())
|
|
33
|
+
|
|
34
|
+
today_arbys = on_command("今日仲裁")
|
|
35
|
+
@today_arbys.handle()
|
|
36
|
+
async def today_arbys_handle():
|
|
37
|
+
await today_arbys.finish(await gen_today_arbys_img())
|
|
38
|
+
|
|
39
|
+
fast_arbys = on_command("高效仲裁")
|
|
40
|
+
@fast_arbys.handle()
|
|
41
|
+
async def fast_arbys_handle():
|
|
42
|
+
await fast_arbys.finish(await gen_s_arbys_img())
|
|
43
|
+
# -----------------------------------
|
|
44
|
+
|
|
45
|
+
# ----- Void Fissures -----
|
|
46
|
+
vf = on_command("裂缝")
|
|
47
|
+
@vf.handle()
|
|
48
|
+
async def vf_handle(event: MessageEvent):
|
|
49
|
+
img_message = await gen_void_fissures_img(False)
|
|
50
|
+
reply = MessageSegment.reply(event.message_id)
|
|
51
|
+
message = Message([reply, img_message])
|
|
52
|
+
await vf.finish(message)
|
|
53
|
+
|
|
54
|
+
hard_vf = on_command("钢铁裂缝")
|
|
55
|
+
@hard_vf.handle()
|
|
56
|
+
async def hard_vf_handle(event: MessageEvent):
|
|
57
|
+
img_message = await gen_void_fissures_img(True)
|
|
58
|
+
reply = MessageSegment.reply(event.message_id)
|
|
59
|
+
message = Message([reply, img_message])
|
|
60
|
+
await hard_vf.finish(message)
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
# 2026年7月22日
|
|
5
5
|
|
|
6
6
|
from typing import Optional
|
|
7
|
-
|
|
7
|
+
from pathlib import Path
|
|
8
8
|
from nonebot.log import logger
|
|
9
9
|
from playwright.async_api import Browser, Page, Playwright, async_playwright
|
|
10
10
|
|
|
11
11
|
_playwright: Optional[Playwright] = None
|
|
12
12
|
_browser: Optional[Browser] = None
|
|
13
|
-
|
|
13
|
+
TEMPLATES_DIR = Path(__file__).parent .parent / "assets" / "templates"
|
|
14
14
|
|
|
15
15
|
async def _launch_browser() -> Browser:
|
|
16
16
|
"""启动无头 Chromium 浏览器实例"""
|
|
@@ -40,7 +40,7 @@ async def html_to_pic(html: str) -> bytes:
|
|
|
40
40
|
page: Page = await browser.new_page()
|
|
41
41
|
try:
|
|
42
42
|
await page.set_content(html, wait_until="networkidle")
|
|
43
|
-
await page.wait_for_timeout(
|
|
43
|
+
await page.wait_for_timeout(1000)
|
|
44
44
|
body = page.locator("body")
|
|
45
45
|
return await body.screenshot(type="png")
|
|
46
46
|
finally:
|
|
@@ -57,3 +57,8 @@ async def shutdown_browser():
|
|
|
57
57
|
await _playwright.stop()
|
|
58
58
|
_playwright = None
|
|
59
59
|
logger.info("Playwright 浏览器已关闭")
|
|
60
|
+
|
|
61
|
+
def read_template(name: str) -> str:
|
|
62
|
+
"""根据文件名从 templates 下读取模板,返回字符串。"""
|
|
63
|
+
with open(TEMPLATES_DIR / f"{name}.html", "r", encoding="utf-8") as f:
|
|
64
|
+
return f.read()
|
|
@@ -2,17 +2,22 @@ import json
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
import time
|
|
4
4
|
from nonebot.adapters.onebot.v11 import Message, MessageSegment
|
|
5
|
-
from ...common.browser_manager import html_to_pic
|
|
5
|
+
from ...common.browser_manager import html_to_pic, read_template
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
|
|
8
8
|
asset = Path(__file__).parent.parent.parent / "assets"
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
# 第一件事先获取数据
|
|
12
|
-
# 读取 final_arbys
|
|
10
|
+
def read_final_arbys() -> dict:
|
|
13
11
|
with open(asset / "final_arbys.json", "r", encoding="utf-8") as f:
|
|
14
12
|
final_arbys = json.load(f)
|
|
13
|
+
f.close()
|
|
14
|
+
return final_arbys
|
|
15
|
+
|
|
16
|
+
async def gen_current_arbys_img() -> Message:
|
|
17
|
+
# 读取 final_arbys
|
|
18
|
+
final_arbys = read_final_arbys()
|
|
15
19
|
|
|
20
|
+
# 根据时间计算出当前的仲裁任务与下一次仲裁任务
|
|
16
21
|
now = time.time()
|
|
17
22
|
current_arby = None
|
|
18
23
|
next_arby = None
|
|
@@ -25,8 +30,7 @@ async def gen_current_arbys_img() -> Message:
|
|
|
25
30
|
|
|
26
31
|
data_json = json.dumps({"current": current_arby, "next": next_arby}, ensure_ascii=False, indent=4)
|
|
27
32
|
|
|
28
|
-
|
|
29
|
-
template = fp.read()
|
|
33
|
+
template = read_template("current_arbys")
|
|
30
34
|
|
|
31
35
|
html = template.replace("{{DATA}}", data_json)
|
|
32
36
|
img = await html_to_pic(html)
|
|
@@ -37,8 +41,7 @@ async def gen_today_arbys_img() -> Message:
|
|
|
37
41
|
仲裁任务固定每小时一个,获取今天 00:00:00 时的时间戳为第一个,此后每 3600 秒一个,一直到 23:00:00
|
|
38
42
|
:return:
|
|
39
43
|
"""
|
|
40
|
-
|
|
41
|
-
final_arbys = json.load(f)
|
|
44
|
+
final_arbys = read_final_arbys()
|
|
42
45
|
|
|
43
46
|
now = datetime.now()
|
|
44
47
|
today_start = datetime(now.year, now.month, now.day, 0, 0, 0)
|
|
@@ -53,7 +56,31 @@ async def gen_today_arbys_img() -> Message:
|
|
|
53
56
|
today_list.append(arby)
|
|
54
57
|
|
|
55
58
|
data_json = json.dumps(today_list, ensure_ascii=False, indent=4)
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
template = read_template("today_arbys")
|
|
60
|
+
img = await html_to_pic(template.replace("{{DATA}}", data_json))
|
|
61
|
+
return Message(MessageSegment.image(img))
|
|
62
|
+
|
|
63
|
+
async def gen_s_arbys_img() -> Message:
|
|
64
|
+
"""
|
|
65
|
+
筛选出 5 个即将到来的 S 级仲裁。
|
|
66
|
+
:return:
|
|
67
|
+
"""
|
|
68
|
+
# 读取数据
|
|
69
|
+
final_arbys = read_final_arbys()
|
|
70
|
+
|
|
71
|
+
# 获取当前时间戳,然后找到第一个比当前时间靠后的任务,随后开始筛选 S Tier
|
|
72
|
+
s_list = []
|
|
73
|
+
now = time.time()
|
|
74
|
+
for ts, arby in final_arbys.items():
|
|
75
|
+
if int(ts) < now:
|
|
76
|
+
continue
|
|
77
|
+
else:
|
|
78
|
+
tier = arby.get("tier", "null")
|
|
79
|
+
if tier == "S":
|
|
80
|
+
s_list.append(arby)
|
|
81
|
+
if len(s_list) == 5:
|
|
82
|
+
break
|
|
83
|
+
template = read_template("s_arbys")
|
|
84
|
+
data_json = json.dumps(s_list, ensure_ascii=False, indent=4)
|
|
58
85
|
img = await html_to_pic(template.replace("{{DATA}}", data_json))
|
|
59
86
|
return Message(MessageSegment.image(img))
|
|
@@ -9,7 +9,7 @@ from nonebot.adapters.onebot.v11 import MessageSegment
|
|
|
9
9
|
|
|
10
10
|
from .data_processor import extract_conquests, render_archimedea_panel, transform_to_archimedea_data
|
|
11
11
|
from ...common.browser_manager import html_to_pic
|
|
12
|
-
from ...common
|
|
12
|
+
from ...common import fetch_world_state
|
|
13
13
|
|
|
14
14
|
_TEMPLATE_DIR = Path(__file__).parent.parent.parent / "assets" / "templates"
|
|
15
15
|
|
|
@@ -9,7 +9,7 @@ from nonebot.adapters.onebot.v11 import MessageSegment
|
|
|
9
9
|
|
|
10
10
|
from .data_processor import extract_conquests, render_archimedea_panel, transform_to_archimedea_data
|
|
11
11
|
from ...common.browser_manager import html_to_pic
|
|
12
|
-
from ...common
|
|
12
|
+
from ...common import fetch_world_state
|
|
13
13
|
|
|
14
14
|
_TEMPLATE_DIR = Path(__file__).parent.parent.parent / "assets" / "templates"
|
|
15
15
|
|
|
@@ -9,7 +9,7 @@ from pathlib import Path
|
|
|
9
9
|
from nonebot.adapters.onebot.v11 import MessageSegment
|
|
10
10
|
|
|
11
11
|
from ...common.browser_manager import html_to_pic
|
|
12
|
-
from ...common
|
|
12
|
+
from ...common import fetch_world_state
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
_CST = timezone(timedelta(hours=8)) # 中国标准时间 UTC+8
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
from ...common import fetch_world_state
|
|
5
|
+
from ...common.browser_manager import html_to_pic, read_template
|
|
6
|
+
from nonebot.adapters.onebot.v11 import Message, MessageSegment
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
ASSETS_DIR = Path(__file__).parent.parent.parent / "assets"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def void_level_map(level: str) -> str:
|
|
13
|
+
"""
|
|
14
|
+
输入虚空裂缝等级,返回中文名称
|
|
15
|
+
:param level: VoidT1、VoidT2...
|
|
16
|
+
:return:
|
|
17
|
+
"""
|
|
18
|
+
void_map = {
|
|
19
|
+
"VoidT1": "古纪",
|
|
20
|
+
"VoidT2": "前纪",
|
|
21
|
+
"VoidT3": "中纪",
|
|
22
|
+
"VoidT4": "后纪",
|
|
23
|
+
"VoidT5": "安魂",
|
|
24
|
+
"VoidT6": "全能",
|
|
25
|
+
"null": "错误"
|
|
26
|
+
}
|
|
27
|
+
return void_map[level]
|
|
28
|
+
|
|
29
|
+
async def gen_void_fissures_img(is_hard: bool) -> MessageSegment:
|
|
30
|
+
"""
|
|
31
|
+
生成普通虚空裂缝的图片
|
|
32
|
+
:return: 图片消息
|
|
33
|
+
"""
|
|
34
|
+
# 获取世界信息
|
|
35
|
+
world_state = await fetch_world_state()
|
|
36
|
+
all_void_fissures = world_state.get("ActiveMissions", None)
|
|
37
|
+
if not all_void_fissures or not isinstance(all_void_fissures, List):
|
|
38
|
+
return MessageSegment.text("数据源错误,请联系管理员")
|
|
39
|
+
|
|
40
|
+
# 读取地图数据,待会使用
|
|
41
|
+
with open(ASSETS_DIR / "ExportRegions_zh.json", "r", encoding="utf-8") as f:
|
|
42
|
+
nodes = json.load(f)
|
|
43
|
+
|
|
44
|
+
vf_data = []
|
|
45
|
+
# 遍历数组筛选指定裂缝
|
|
46
|
+
for void_fissure in all_void_fissures:
|
|
47
|
+
# 如果 is_hard 为 True 我们要筛选出
|
|
48
|
+
|
|
49
|
+
if void_fissure.get("Hard", False) != is_hard:
|
|
50
|
+
continue
|
|
51
|
+
|
|
52
|
+
# 摘出数据
|
|
53
|
+
node = nodes.get(void_fissure.get("Node", "null"), None)
|
|
54
|
+
vf_data.append({
|
|
55
|
+
"start": void_fissure["Activation"]["$date"]["$numberLong"],
|
|
56
|
+
"end": void_fissure["Expiry"]["$date"]["$numberLong"],
|
|
57
|
+
"region": node.get("systemName", "null"),
|
|
58
|
+
"name": node.get("name", "null"),
|
|
59
|
+
"type": node.get("missionName", "null"),
|
|
60
|
+
"faction": node.get("faction", "null"),
|
|
61
|
+
"modifier": void_level_map(void_fissure.get("Modifier", "null")),
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
template = read_template("void_fissures")
|
|
65
|
+
if is_hard:
|
|
66
|
+
title = "虚空裂缝(钢铁)"
|
|
67
|
+
else:
|
|
68
|
+
title = "虚空裂缝(普通)"
|
|
69
|
+
template = template.replace("{{TITLE}}", title)
|
|
70
|
+
template =template.replace("{{DATA}}", json.dumps(vf_data, ensure_ascii=False, indent=4))
|
|
71
|
+
return MessageSegment.image(await html_to_pic(template))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nonebot-plugin-aawarframe
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: aa 的 Warframe 助手
|
|
5
5
|
Author-email: nekox41 <aameow@outlook.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -48,8 +48,8 @@ _✨ Aa 的 Warframe 助手,用于查询游戏状态。 ✨_
|
|
|
48
48
|
- [x] 深层科研
|
|
49
49
|
- [ ] 查询仲裁任务
|
|
50
50
|
- [x] 当前仲裁任务与下一次仲裁
|
|
51
|
-
- [
|
|
52
|
-
- [
|
|
51
|
+
- [x] 今日所有仲裁
|
|
52
|
+
- [x] 未来 5 个 S 级仲裁时间
|
|
53
53
|
- [ ] Warframe Market 商品信息查询
|
|
54
54
|
|
|
55
55
|
## 💿 安装
|
|
@@ -95,12 +95,14 @@ _✨ Aa 的 Warframe 助手,用于查询游戏状态。 ✨_
|
|
|
95
95
|
|
|
96
96
|
## 🎉 使用
|
|
97
97
|
### 指令表
|
|
98
|
-
| 指令 | 权限 | 需要@ | 范围 |
|
|
99
|
-
|
|
100
|
-
| 夜灵平原 | 所有人 | 否 | 群聊 |
|
|
101
|
-
| 时光科研 | 所有人 | 否 | 群聊 |
|
|
102
|
-
| 深层科研 | 所有人 | 否 | 群聊 |
|
|
103
|
-
| 仲裁 | 所有人 | 否 | 群聊 |
|
|
98
|
+
| 指令 | 权限 | 需要@ | 范围 | 说明 |
|
|
99
|
+
|:----:|:---:|:---:|:--:|:----------------:|
|
|
100
|
+
| 夜灵平原 | 所有人 | 否 | 群聊 | 返回夜灵平原时间 |
|
|
101
|
+
| 时光科研 | 所有人 | 否 | 群聊 | 返回本周时光科研 |
|
|
102
|
+
| 深层科研 | 所有人 | 否 | 群聊 | 返回本周深层科研 |
|
|
103
|
+
| 仲裁 | 所有人 | 否 | 群聊 | 返回当前仲裁和下一次仲裁 |
|
|
104
|
+
| 今日仲裁 | 所有人 | 否 | 群聊 | 返回今日所有仲裁 |
|
|
105
|
+
| 高效仲裁 | 所有人 | 否 | 群聊 | 返回 5 个接下来的 S 级仲裁 |
|
|
104
106
|
### 效果图
|
|
105
107
|
<p><img src="https://github.com/nekox41/nonebot-plugin-aawarframe/blob/master/imgs/example1.png" alt="效果图1"></p>
|
|
106
108
|
<p><img src="https://github.com/nekox41/nonebot-plugin-aawarframe/blob/master/imgs/example2.png" alt="效果图2"></p>
|
|
@@ -17,14 +17,16 @@ nonebot_plugin_aawarframe/assets/variables.json
|
|
|
17
17
|
nonebot_plugin_aawarframe/assets/templates/archimedea.html
|
|
18
18
|
nonebot_plugin_aawarframe/assets/templates/current_arbys.html
|
|
19
19
|
nonebot_plugin_aawarframe/assets/templates/eidolon_clock.html
|
|
20
|
+
nonebot_plugin_aawarframe/assets/templates/s_arbys.html
|
|
20
21
|
nonebot_plugin_aawarframe/assets/templates/today_arbys.html
|
|
22
|
+
nonebot_plugin_aawarframe/assets/templates/void_fissures.html
|
|
21
23
|
nonebot_plugin_aawarframe/common/__init__.py
|
|
22
24
|
nonebot_plugin_aawarframe/common/browser_manager.py
|
|
23
|
-
nonebot_plugin_aawarframe/common/data_fetcher.py
|
|
24
25
|
nonebot_plugin_aawarframe/service/__init__.py
|
|
25
26
|
nonebot_plugin_aawarframe/service/arbys/__init__.py
|
|
26
27
|
nonebot_plugin_aawarframe/service/archimedea/__init__.py
|
|
27
28
|
nonebot_plugin_aawarframe/service/archimedea/data_processor.py
|
|
28
29
|
nonebot_plugin_aawarframe/service/archimedea/deep.py
|
|
29
30
|
nonebot_plugin_aawarframe/service/archimedea/temporal.py
|
|
30
|
-
nonebot_plugin_aawarframe/service/earth/__init__.py
|
|
31
|
+
nonebot_plugin_aawarframe/service/earth/__init__.py
|
|
32
|
+
nonebot_plugin_aawarframe/service/voidfissures/__init__.py
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
from nonebot import on_command
|
|
2
|
-
from .service.archimedea.deep import gen_deep_img
|
|
3
|
-
from .service.archimedea.temporal import gen_temporal_img
|
|
4
|
-
from .service.earth import gen_eidolon_img
|
|
5
|
-
from .service.arbys import gen_current_arbys_img, gen_today_arbys_img
|
|
6
|
-
# 夜灵平原
|
|
7
|
-
cetus = on_command("夜灵平原")
|
|
8
|
-
|
|
9
|
-
@cetus.handle()
|
|
10
|
-
async def cetus_handle():
|
|
11
|
-
await cetus.finish(await gen_eidolon_img())
|
|
12
|
-
|
|
13
|
-
# 时光科研
|
|
14
|
-
temporal = on_command("时光科研")
|
|
15
|
-
|
|
16
|
-
@temporal.handle()
|
|
17
|
-
async def temporal_handle():
|
|
18
|
-
await temporal.finish(await gen_temporal_img())
|
|
19
|
-
|
|
20
|
-
# 深层科研
|
|
21
|
-
deep = on_command("深层科研")
|
|
22
|
-
|
|
23
|
-
@deep.handle()
|
|
24
|
-
async def deep_handle():
|
|
25
|
-
await deep.finish(await gen_deep_img())
|
|
26
|
-
|
|
27
|
-
current_arbys = on_command("仲裁")
|
|
28
|
-
@current_arbys.handle()
|
|
29
|
-
async def current_arbys_handle():
|
|
30
|
-
await current_arbys.finish(await gen_current_arbys_img())
|
|
31
|
-
|
|
32
|
-
today_arbys = on_command("今日仲裁")
|
|
33
|
-
@today_arbys.handle()
|
|
34
|
-
async def today_arbys_handle():
|
|
35
|
-
await today_arbys.finish(await gen_today_arbys_img())
|
|
36
|
-
|
|
37
|
-
fast_arbys = on_command("高效仲裁")
|
|
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
|
|
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
|