남우성

Create each_stamp information system

...@@ -43,8 +43,11 @@ module.exports ={ ...@@ -43,8 +43,11 @@ module.exports ={
43 case '도화가' : job_number = 7; class_number = 2; break; 43 case '도화가' : job_number = 7; class_number = 2; break;
44 default: interaction.reply('올바른 직업명을 입력해주세요!'); return; 44 default: interaction.reply('올바른 직업명을 입력해주세요!'); return;
45 } 45 }
46 + const tempembed = new MessageEmbed()
47 + .setColor('#F7819F')
48 + .setDescription('작업중입니다!(1~2분 가량 소요될 수 있습니다)')
46 49
47 - await interaction.reply('작업중입니다!(1~2분 가량 소요될 수 있습니다)'); 50 + interaction.reply({ embeds: [tempembed], allowedMentions: {repliedUser: false} });
48 51
49 await puppeteer.launch().then(async browser => { 52 await puppeteer.launch().then(async browser => {
50 const page = await browser.newPage(); 53 const page = await browser.newPage();
...@@ -90,25 +93,29 @@ module.exports ={ ...@@ -90,25 +93,29 @@ module.exports ={
90 console.error(error); 93 console.error(error);
91 }) 94 })
92 95
93 - var sortary = []; 96 + var each_sortary = [];
94 for(var name in each_stamp){ 97 for(var name in each_stamp){
95 - sortary.push([name, each_stamp[name] * 5]); 98 + each_sortary.push([name, each_stamp[name] * 5]);
96 } 99 }
97 - sortary.sort(function(a, b){ 100 + each_sortary.sort(function(a, b){
98 return b[1] - a[1]; 101 return b[1] - a[1];
99 }) 102 })
100 - console.log(sortary);
101 103
102 -/* const stampembed = new MessageEmbed() 104 + let each_stamp_print = "";
105 + for(i = 0; i < each_sortary.length; i++){
106 + each_stamp_print += each_sortary[i][0] + ': ' + each_sortary[i][1] + '% \n';
107 + }
108 +
109 + const stampembed = new MessageEmbed()
103 .setColor('#F7819F') 110 .setColor('#F7819F')
104 .setTitle(class_name) 111 .setTitle(class_name)
105 .setDescription(class_name + '의 상위 20명 각인 정보') 112 .setDescription(class_name + '의 상위 20명 각인 정보')
106 - .addField( 113 + .addFields(
107 - {name: "각인 상세 정보", value: } 114 + {name: "각인 상세 정보", value: each_stamp_print, inline: true},
108 - ) */ 115 + {name: "각인 전체 정보", value: '개발중', inline: true}
109 - 116 + )
110 - interaction.editReply('test');
111 117
118 + interaction.editReply({ embeds: [stampembed], allowedMentions: {repliedUser: false} });
112 }) 119 })
113 } 120 }
114 } 121 }
...\ No newline at end of file ...\ No newline at end of file
......