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-30 20:08:50 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1fd678ec6e765867671fb0ebb2108e44d554f009
1fd678ec
1 parent
ff9b6db3
Update mari command
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
commands/mari.js
commands/mari.js
View file @
1fd678e
...
...
@@ -32,5 +32,22 @@ module.exports = {
.
setLabel
(
"현재 마리샵 정보 조회"
)
.
setStyle
(
"SECONDARY"
)
);
async
function
getHTML
()
{
try
{
return
await
axios
.
get
(
"https://lostark.game.onstove.com/Shop#mari"
);
}
catch
(
error
)
{
console
.
error
(
error
);
}
};
await
getHTML
().
then
(
html
=>
{
const
$
=
cheerio
.
load
(
html
.
data
);
const
bodyList
=
$
(
"ul.list-items"
).
children
(
"li"
);
bodyList
.
each
(
function
(
i
,
elem
)
{
itemInfo
[
i
]
=
{
name
:
$
(
this
).
find
(
"span.item-name"
).
text
(),
amount
:
$
(
this
).
find
(
"span.amount"
).
text
()};
});
return
itemInfo
;
});
},
};
\ No newline at end of file
...
...
Please
register
or
login
to post a comment