nonebot-plugin-aawarframe 0.3.2__tar.gz → 0.3.3__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.3.3}/PKG-INFO +11 -9
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/README.md +10 -8
- nonebot_plugin_aawarframe-0.3.3/nonebot_plugin_aawarframe/assets/templates/s_arbys.html +193 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/commands.py +5 -2
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/common/browser_manager.py +7 -2
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/service/arbys/__init__.py +37 -10
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe.egg-info/PKG-INFO +11 -9
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe.egg-info/SOURCES.txt +1 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/pyproject.toml +1 -1
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/LICENSE +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/__init__.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/assets/ExportRegions_zh.json +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/assets/conquest_zh.json +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/assets/faction_type.json +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/assets/final_arbys.json +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/assets/mission_type.json +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/assets/templates/archimedea.html +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/assets/templates/current_arbys.html +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/assets/templates/eidolon_clock.html +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/assets/templates/today_arbys.html +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/assets/variables.json +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/common/__init__.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/common/data_fetcher.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/service/__init__.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/service/archimedea/__init__.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/service/archimedea/data_processor.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/service/archimedea/deep.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/service/archimedea/temporal.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe/service/earth/__init__.py +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe.egg-info/dependency_links.txt +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe.egg-info/requires.txt +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/nonebot_plugin_aawarframe.egg-info/top_level.txt +0 -0
- {nonebot_plugin_aawarframe-0.3.2 → nonebot_plugin_aawarframe-0.3.3}/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
|
+
Version: 0.3.3
|
|
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>
|
|
@@ -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>
|
|
@@ -2,7 +2,7 @@ from nonebot import on_command
|
|
|
2
2
|
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
|
-
from .service.arbys import gen_current_arbys_img, gen_today_arbys_img
|
|
5
|
+
from .service.arbys import gen_current_arbys_img, gen_today_arbys_img, gen_s_arbys_img
|
|
6
6
|
# 夜灵平原
|
|
7
7
|
cetus = on_command("夜灵平原")
|
|
8
8
|
|
|
@@ -34,4 +34,7 @@ today_arbys = on_command("今日仲裁")
|
|
|
34
34
|
async def today_arbys_handle():
|
|
35
35
|
await today_arbys.finish(await gen_today_arbys_img())
|
|
36
36
|
|
|
37
|
-
fast_arbys = on_command("高效仲裁")
|
|
37
|
+
fast_arbys = on_command("高效仲裁")
|
|
38
|
+
@fast_arbys.handle()
|
|
39
|
+
async def fast_arbys_handle():
|
|
40
|
+
await fast_arbys.finish(await gen_s_arbys_img())
|
|
@@ -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 浏览器实例"""
|
|
@@ -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))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nonebot-plugin-aawarframe
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
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,6 +17,7 @@ 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
|
|
21
22
|
nonebot_plugin_aawarframe/common/__init__.py
|
|
22
23
|
nonebot_plugin_aawarframe/common/browser_manager.py
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|