Showing
1 changed file
with
15 additions
and
0 deletions
| ... | @@ -12,7 +12,13 @@ module.exports = { | ... | @@ -12,7 +12,13 @@ module.exports = { |
| 12 | var isMaintainence = false; | 12 | var isMaintainence = false; |
| 13 | await axios.get("https://lostark.game.onstove.com").then(html=>{ | 13 | await axios.get("https://lostark.game.onstove.com").then(html=>{ |
| 14 | const $ = cheerio.load(html.data); | 14 | const $ = cheerio.load(html.data); |
| 15 | + textMaintainence = $("div.time_wraper").find("h3").text(); | ||
| 16 | + timeMaintainence = $("strong#inspectionTime").text(); | ||
| 17 | + console.log(timeMaintainence); | ||
| 18 | + if(textMaintainence == "예상 점검 완료 시간") | ||
| 19 | + isMaintainence = true; | ||
| 15 | }) | 20 | }) |
| 21 | + if(!isMaintainence){ | ||
| 16 | const buttonsRow = new MessageActionRow() | 22 | const buttonsRow = new MessageActionRow() |
| 17 | .addComponents( | 23 | .addComponents( |
| 18 | new MessageButton() | 24 | new MessageButton() |
| ... | @@ -32,6 +38,7 @@ module.exports = { | ... | @@ -32,6 +38,7 @@ module.exports = { |
| 32 | .setLabel("현재 마리샵 정보 조회") | 38 | .setLabel("현재 마리샵 정보 조회") |
| 33 | .setStyle("SECONDARY") | 39 | .setStyle("SECONDARY") |
| 34 | ); | 40 | ); |
| 41 | + | ||
| 35 | async function getHTML() { | 42 | async function getHTML() { |
| 36 | try { | 43 | try { |
| 37 | return await axios.get("https://lostark.game.onstove.com/Shop#mari"); | 44 | return await axios.get("https://lostark.game.onstove.com/Shop#mari"); |
| ... | @@ -99,5 +106,13 @@ module.exports = { | ... | @@ -99,5 +106,13 @@ module.exports = { |
| 99 | interaction.update({ embeds: [embed], components: [buttonsRow], allowedMentions: {repliedUser: false}}); | 106 | interaction.update({ embeds: [embed], components: [buttonsRow], allowedMentions: {repliedUser: false}}); |
| 100 | } | 107 | } |
| 101 | }); | 108 | }); |
| 109 | + } | ||
| 110 | + else{ | ||
| 111 | + const embed = new MessageEmbed() | ||
| 112 | + .setTitle("현재 로스트아크가 점검중입니다.") | ||
| 113 | + .setColor("#FAA8F0") | ||
| 114 | + .setDescription(`예상 점검 시간: ${timeMaintainence}`); | ||
| 115 | + interaction.reply({ embeds: [embed], allowedMentions: {repliedUser: false} }); | ||
| 116 | + } | ||
| 102 | }, | 117 | }, |
| 103 | }; | 118 | }; |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment