Skip to content
GitLab
菜单
项目
群组
代码片段
/
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录/注册
切换导航
菜单
打开侧边栏
Zhang Guoqiang
yobot
提交
6b2a17e4
提交
6b2a17e4
编辑于
5月 21, 2020
作者:
windylh
浏览文件
fix:well & add:miner
上级
6b16deb4
变更
2
Hide whitespace changes
Inline
Side-by-side
src/client/ybplugins/gacha.py
浏览文件 @
6b2a17e4
...
...
@@ -169,8 +169,6 @@ class Gacha:
if
today
!=
last_day
:
last_day
=
today
day_times
=
0
if
day_limit
!=
0
and
day_times
+
30
>=
day_limit
:
return
"{}今天剩余抽卡次数不足30次,不能抽一井"
.
format
(
nickname
,
day_times
)
reply
=
""
result
=
""
flag
=
False
...
...
src/client/ybplugins/jjc_consult.py
浏览文件 @
6b2a17e4
...
...
@@ -5,6 +5,7 @@ import time
from
dataclasses
import
dataclass
from
typing
import
Dict
,
List
,
Optional
,
Tuple
from
urllib.parse
import
urljoin
import
numpy
as
np
import
aiohttp
import
requests
...
...
@@ -214,6 +215,41 @@ class Consult:
result
=
search
[
'data'
][
'result'
]
return
list
(
map
(
self
.
_parse_pcrdfans_team
,
result
))
def
miner
(
self
,
cmd
:
str
):
this_season
=
np
.
zeros
(
15001
)
all_season
=
np
.
zeros
(
15001
)
this_season
[
1
:
11
]
=
50
this_season
[
11
:
101
]
=
10
this_season
[
101
:
201
]
=
5
this_season
[
201
:
501
]
=
3
this_season
[
501
:
1001
]
=
2
this_season
[
1001
:
2001
]
=
2
this_season
[
2001
:
4000
]
=
1
this_season
[
4000
:
8000
:
100
]
=
50
this_season
[
8100
:
15001
:
100
]
=
15
all_season
[
1
:
11
]
=
500
all_season
[
11
:
101
]
=
50
all_season
[
101
:
201
]
=
30
all_season
[
201
:
501
]
=
10
all_season
[
501
:
1001
]
=
5
all_season
[
1001
:
2001
]
=
3
all_season
[
2001
:
4001
]
=
2
all_season
[
4001
:
7999
]
=
1
all_season
[
8100
:
15001
:
100
]
=
30
cmd
=
cmd
.
lstrip
()
if
cmd
.
isdigit
()
and
15001
>=
int
(
cmd
)
>=
1
:
rank
=
int
(
cmd
)
rank
=
np
.
clip
(
rank
,
1
,
15001
)
s_all
=
int
(
all_season
[
1
:
rank
].
sum
())
s_this
=
int
(
this_season
[
1
:
rank
].
sum
())
reply
=
"当前排名为:{}
\n
最高排名奖励还剩 {} 钻
\n
历届最高排名还剩 {} 钻"
.
format
(
rank
,
s_this
,
s_all
)
return
reply
else
:
reply
=
"请输入1~15001之间的整数"
return
reply
@
staticmethod
def
match
(
cmd
:
str
)
->
int
:
if
not
cmd
.
startswith
(
"jjc"
):
...
...
@@ -228,6 +264,8 @@ class Consult:
return
3
elif
cmd
.
startswith
(
"jjc日服"
):
return
4
elif
cmd
.
startswith
(
"jjc钻石"
):
return
6
else
:
return
0
...
...
@@ -239,6 +277,8 @@ class Consult:
return
None
elif
match_num
==
5
:
reply
=
"请接5个昵称,空格分隔"
elif
match_num
==
6
:
reply
=
self
.
miner
(
msg
[
"raw_message"
][
5
:])
else
:
try
:
anlz
=
self
.
user_input
(
msg
[
"raw_message"
][
5
:])
...
...
编辑
预览
支持
Markdown
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录