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-19 00:11:34 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
97373221a6d757c1ab1030d10489325f7d559291
97373221
1 parent
45d75494
Update info command
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
commands/info.js
commands/info.js
View file @
9737322
...
...
@@ -14,5 +14,22 @@ module.exports = {
.
setRequired
(
true
)
),
async
execute
(
interaction
)
{
const
nickName
=
interaction
.
options
.
getString
(
"닉네임"
);
async
function
getHTML
()
{
try
{
return
await
axios
.
get
(
encodeURI
(
`https://lostark.game.onstove.com/Profile/Character/
${
nickName
}
`
));
}
catch
(
error
)
{
console
.
error
(
error
);
}
};
await
getHTML
().
then
(
html
=>
{
const
$
=
cheerio
.
load
(
html
.
data
);
if
(
$
(
"div.profile-attention span:nth-child(2)"
).
text
()
===
"캐릭터명을 확인해주세요."
||
$
(
"div.level-info2__expedition"
).
text
().
split
(
"Lv."
)[
1
]
===
"0.00"
){
interaction
.
reply
({
content
:
"`"
+
nickName
+
"`"
+
"이라는 캐릭터는 없습니다"
,
allowedMentions
:
{
repliedUser
:
false
}});
return
;
}
});
}
};
\ No newline at end of file
...
...
Please
register
or
login
to post a comment