-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtools.py
68 lines (62 loc) · 1.85 KB
/
tools.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
def handler(fn):
def inner(*args, **kwargs):
res = fn(*args, **kwargs)
msg = [
{
"h4": {
"content": f"用户名: {res['name']}",
},
},
{
"h4": {
"content": f"账号: {res['account']}",
},
},
]
checkin = res["checkin"]
if checkin["status"]:
msg.append(
{
"table": {
"contents": [
("描述", "内容"),
("登录奖励", f"{checkin['reward']}M"),
("连续登录", f"{checkin['continuous_days']}天"),
("总共获得", f"{checkin['total']}M"),
("签到奖励", f"{checkin['checkin']}M"),
("签到共计", f"{checkin['checkin_total']}M"),
]
}
}
)
else:
msg.append(
{
"txt": {
"content": checkin["msg"],
},
}
)
ad = res["ad"]
if ad["status"]:
msg.append(
{
"table": {
"contents": [
("描述", "内容"),
("广告奖励", f"{ad['ad']}M"),
("广告总计", f"{ad['ad_space_total']}天"),
]
}
}
)
else:
msg.append(
{
"txt": {
"content": ad["msg"],
},
}
)
return msg
return inner