Toggle navigation
Toggle navigation
This project
Loading...
Sign in
유병우
/
lostark-discord-bot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
남우성
2022-05-31 20:42:30 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fc1891870e156c00d2e202c85a5ddef390ab9293
fc189187
1 parent
b0b2b788
Create hole_stamp information system
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
commands/stamp.js
commands/stamp.js
View file @
fc18918
...
...
@@ -77,6 +77,7 @@ module.exports ={
}
var
each_stamp
=
new
Object
;
var
hole_stamp
=
new
Object
;
await
axios
.
all
(
all_url
.
map
((
each
)
=>
axios
.
get
(
encodeURI
(
each
)))).
then
(
axios
.
spread
((...
responses
)
=>
{
for
(
i
=
0
;
i
<
all_url
.
length
;
i
++
){
...
...
@@ -87,6 +88,13 @@ module.exports ={
}
else
{
each_stamp
[
$
(
this
).
find
(
'span'
).
text
()]
=
1
;
}
let
one_stamp
=
$
(
this
).
find
(
'span'
).
text
().
split
(
' Lv'
);
if
(
one_stamp
[
0
]
in
hole_stamp
){
hole_stamp
[
one_stamp
[
0
]]
+=
1
;
}
else
{
hole_stamp
[
one_stamp
[
0
]]
=
1
;
}
})
}
})).
catch
(
error
=>
{
...
...
@@ -105,14 +113,27 @@ module.exports ={
for
(
i
=
0
;
i
<
each_sortary
.
length
;
i
++
){
each_stamp_print
+=
each_sortary
[
i
][
0
]
+
': '
+
each_sortary
[
i
][
1
]
+
'% \n'
;
}
var
hole_sortary
=
[];
for
(
var
one
in
hole_stamp
){
hole_sortary
.
push
([
one
,
hole_stamp
[
one
]
*
5
]);
}
hole_sortary
.
sort
(
function
(
a
,
b
){
return
b
[
1
]
-
a
[
1
];
})
let
hole_stamp_print
=
""
;
for
(
i
=
0
;
i
<
hole_sortary
.
length
;
i
++
){
hole_stamp_print
+=
hole_sortary
[
i
][
0
]
+
': '
+
hole_sortary
[
i
][
1
]
+
'% \n'
;
}
const
stampembed
=
new
MessageEmbed
()
.
setColor
(
'#F7819F'
)
.
setTitle
(
class_name
)
.
setDescription
(
class_name
+
'의 상위 20명 각인 정보'
)
.
addFields
(
{
name
:
"각인
상세 정보"
,
value
:
each
_stamp_print
,
inline
:
true
},
{
name
:
"각인
전체 정보"
,
value
:
'개발중'
,
inline
:
true
}
{
name
:
"각인
전체 정보"
,
value
:
hole
_stamp_print
,
inline
:
true
},
{
name
:
"각인
상세 정보"
,
value
:
each_stamp_print
,
inline
:
true
}
)
interaction
.
editReply
({
embeds
:
[
stampembed
],
allowedMentions
:
{
repliedUser
:
false
}
});
...
...
Please
register
or
login
to post a comment