Showing
1 changed file
with
13 additions
and
0 deletions
... | @@ -14,5 +14,18 @@ module.exports = { | ... | @@ -14,5 +14,18 @@ module.exports = { |
14 | .setRequired(true) | 14 | .setRequired(true) |
15 | ), | 15 | ), |
16 | async execute(interaction) { | 16 | async execute(interaction) { |
17 | + async function getHTML() { | ||
18 | + try { | ||
19 | + return await axios.get(encodeURI(`https://lostark.game.onstove.com/Profile/Character/${interaction.options.getString("닉네임")}`)); | ||
20 | + } catch (error) { | ||
21 | + console.error(error); | ||
22 | + } | ||
23 | + }; | ||
24 | + await getHTML().then(html=>{ | ||
25 | + const $ = cheerio.load(html.data); | ||
26 | + open(`https://loawa.com/char/${interaction.options.getString("닉네임")}`); | ||
27 | + interaction.reply({content: `${interaction.options.getString("닉네임")}의 로아와 정보로 이동합니다.`, allowedMentions: {repliedUser: false}}); | ||
28 | + }); | ||
29 | + | ||
17 | }, | 30 | }, |
18 | }; | 31 | }; |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment