nonebot-plugin-aawarframe 0.3.3__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.
Files changed (35) hide show
  1. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/PKG-INFO +1 -1
  2. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/templates/current_arbys.html +1 -1
  3. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/templates/eidolon_clock.html +32 -33
  4. nonebot_plugin_aawarframe-0.4.1/nonebot_plugin_aawarframe/assets/templates/void_fissures.html +242 -0
  5. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/commands.py +24 -4
  6. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/common/browser_manager.py +1 -1
  7. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/service/archimedea/deep.py +1 -1
  8. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/service/archimedea/temporal.py +1 -1
  9. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/service/earth/__init__.py +1 -1
  10. nonebot_plugin_aawarframe-0.4.1/nonebot_plugin_aawarframe/service/voidfissures/__init__.py +71 -0
  11. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe.egg-info/PKG-INFO +1 -1
  12. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe.egg-info/SOURCES.txt +3 -2
  13. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/pyproject.toml +1 -1
  14. nonebot_plugin_aawarframe-0.3.3/nonebot_plugin_aawarframe/service/archimedea/__init__.py +0 -0
  15. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/LICENSE +0 -0
  16. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/README.md +0 -0
  17. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/__init__.py +0 -0
  18. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/ExportRegions_zh.json +0 -0
  19. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/conquest_zh.json +0 -0
  20. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/faction_type.json +0 -0
  21. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/final_arbys.json +0 -0
  22. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/mission_type.json +0 -0
  23. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/templates/archimedea.html +0 -0
  24. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/templates/s_arbys.html +0 -0
  25. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/templates/today_arbys.html +0 -0
  26. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/assets/variables.json +0 -0
  27. /nonebot_plugin_aawarframe-0.3.3/nonebot_plugin_aawarframe/common/data_fetcher.py → /nonebot_plugin_aawarframe-0.4.1/nonebot_plugin_aawarframe/common/__init__.py +0 -0
  28. {nonebot_plugin_aawarframe-0.3.3/nonebot_plugin_aawarframe/common → nonebot_plugin_aawarframe-0.4.1/nonebot_plugin_aawarframe/service}/__init__.py +0 -0
  29. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/service/arbys/__init__.py +0 -0
  30. {nonebot_plugin_aawarframe-0.3.3/nonebot_plugin_aawarframe/service → nonebot_plugin_aawarframe-0.4.1/nonebot_plugin_aawarframe/service/archimedea}/__init__.py +0 -0
  31. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe/service/archimedea/data_processor.py +0 -0
  32. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe.egg-info/dependency_links.txt +0 -0
  33. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe.egg-info/requires.txt +0 -0
  34. {nonebot_plugin_aawarframe-0.3.3 → nonebot_plugin_aawarframe-0.4.1}/nonebot_plugin_aawarframe.egg-info/top_level.txt +0 -0
  35. {nonebot_plugin_aawarframe-0.3.3 → 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.3
3
+ Version: 0.4.1
4
4
  Summary: aa 的 Warframe 助手
5
5
  Author-email: nekox41 <aameow@outlook.com>
6
6
  License-Expression: MIT
@@ -195,7 +195,7 @@
195
195
  </div>
196
196
 
197
197
  <script>
198
- const data = {{DATA}}
198
+ const data = {{DATA}};
199
199
 
200
200
  function formatTime(timestamp) {
201
201
  const date = new Date(timestamp * 1000);
@@ -6,8 +6,7 @@
6
6
  body {
7
7
  margin: 0;
8
8
  padding: 0;
9
- width: 900px;
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: 720px; /* 适当缩小一点,避免太挤 */
54
- max-height: 1080px;
53
+ width: 90%; /* 铺满 body 的 90% */
55
54
  background: linear-gradient(145deg, #fff5f8, #ffe9f0, #ffe0eb);
56
- border-radius: 48px;
55
+ border-radius: 40px;
57
56
  overflow: hidden;
58
57
  box-shadow:
59
- 0 40px 90px -20px rgba(255, 105, 180, 0.45),
60
- 0 0 0 1px rgba(255, 182, 193, 0.55) inset,
61
- 0 20px 50px rgba(255, 140, 170, 0.3);
62
- border: 4px solid rgba(255, 182, 193, 0.7);
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: 26px 36px;
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.72rem;
81
+ font-size: 1.65rem;
83
82
  font-weight: 600;
84
83
  color: #5c2a3a;
85
- letter-spacing: 2.8px;
86
- padding: 34px 36px;
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.55rem;
92
+ font-size: 2.35rem;
94
93
  font-weight: 600;
95
94
  color: #d14a7e;
96
- padding: 42px 36px;
97
- letter-spacing: 1.2px;
98
- text-shadow: 0 3px 18px rgba(255, 105, 180, 0.4);
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.28rem;
104
+ font-size: 1.2rem;
106
105
  font-weight: 600;
107
106
  color: #e06a9a;
108
- letter-spacing: 4.5px;
109
- padding: 22px 36px 19px;
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: 2.05rem;
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: 28px 36px;
121
- letter-spacing: 6px;
119
+ padding: 22px 30px;
120
+ letter-spacing: 5px;
122
121
  }
123
122
 
124
123
  tr:last-child .time {
125
- border-bottom-left-radius: 42px;
126
- border-bottom-right-radius: 42px;
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: 52px;
139
- opacity: 0.13;
140
- top: 55px;
141
- left: 55px;
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: 72px;
149
- opacity: 0.10;
150
- top: 120px;
151
- right: 55px;
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,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>
@@ -3,6 +3,8 @@ from .service.archimedea.deep import gen_deep_img
3
3
  from .service.archimedea.temporal import gen_temporal_img
4
4
  from .service.earth import gen_eidolon_img
5
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
6
8
  # 夜灵平原
7
9
  cetus = on_command("夜灵平原")
8
10
 
@@ -10,20 +12,20 @@ cetus = on_command("夜灵平原")
10
12
  async def cetus_handle():
11
13
  await cetus.finish(await gen_eidolon_img())
12
14
 
13
- # 时光科研
15
+ # ----- Archimedea -----
14
16
  temporal = on_command("时光科研")
15
-
16
17
  @temporal.handle()
17
18
  async def temporal_handle():
18
19
  await temporal.finish(await gen_temporal_img())
19
20
 
20
21
  # 深层科研
21
22
  deep = on_command("深层科研")
22
-
23
23
  @deep.handle()
24
24
  async def deep_handle():
25
25
  await deep.finish(await gen_deep_img())
26
+ # ----------------------
26
27
 
28
+ # -------- Arbitration ---------------
27
29
  current_arbys = on_command("仲裁")
28
30
  @current_arbys.handle()
29
31
  async def current_arbys_handle():
@@ -37,4 +39,22 @@ async def today_arbys_handle():
37
39
  fast_arbys = on_command("高效仲裁")
38
40
  @fast_arbys.handle()
39
41
  async def fast_arbys_handle():
40
- await fast_arbys.finish(await gen_s_arbys_img())
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)
@@ -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(3000)
43
+ await page.wait_for_timeout(1000)
44
44
  body = page.locator("body")
45
45
  return await body.screenshot(type="png")
46
46
  finally:
@@ -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.data_fetcher import fetch_world_state
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.data_fetcher import fetch_world_state
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.data_fetcher import fetch_world_state
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.3
3
+ Version: 0.4.1
4
4
  Summary: aa 的 Warframe 助手
5
5
  Author-email: nekox41 <aameow@outlook.com>
6
6
  License-Expression: MIT
@@ -19,13 +19,14 @@ nonebot_plugin_aawarframe/assets/templates/current_arbys.html
19
19
  nonebot_plugin_aawarframe/assets/templates/eidolon_clock.html
20
20
  nonebot_plugin_aawarframe/assets/templates/s_arbys.html
21
21
  nonebot_plugin_aawarframe/assets/templates/today_arbys.html
22
+ nonebot_plugin_aawarframe/assets/templates/void_fissures.html
22
23
  nonebot_plugin_aawarframe/common/__init__.py
23
24
  nonebot_plugin_aawarframe/common/browser_manager.py
24
- nonebot_plugin_aawarframe/common/data_fetcher.py
25
25
  nonebot_plugin_aawarframe/service/__init__.py
26
26
  nonebot_plugin_aawarframe/service/arbys/__init__.py
27
27
  nonebot_plugin_aawarframe/service/archimedea/__init__.py
28
28
  nonebot_plugin_aawarframe/service/archimedea/data_processor.py
29
29
  nonebot_plugin_aawarframe/service/archimedea/deep.py
30
30
  nonebot_plugin_aawarframe/service/archimedea/temporal.py
31
- nonebot_plugin_aawarframe/service/earth/__init__.py
31
+ nonebot_plugin_aawarframe/service/earth/__init__.py
32
+ nonebot_plugin_aawarframe/service/voidfissures/__init__.py
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nonebot-plugin-aawarframe"
3
- version = "0.3.3"
3
+ version = "0.4.1"
4
4
  description = "aa 的 Warframe 助手"
5
5
  authors = [
6
6
  {name = "nekox41",email = "aameow@outlook.com"},