유병우

Update info command

......@@ -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
......