남우성

Create each_stamp information system

......@@ -43,8 +43,11 @@ module.exports ={
case '도화가' : job_number = 7; class_number = 2; break;
default: interaction.reply('올바른 직업명을 입력해주세요!'); return;
}
await interaction.reply('작업중입니다!(1~2분 가량 소요될 수 있습니다)');
const tempembed = new MessageEmbed()
.setColor('#F7819F')
.setDescription('작업중입니다!(1~2분 가량 소요될 수 있습니다)')
interaction.reply({ embeds: [tempembed], allowedMentions: {repliedUser: false} });
await puppeteer.launch().then(async browser => {
const page = await browser.newPage();
......@@ -90,25 +93,29 @@ module.exports ={
console.error(error);
})
var sortary = [];
var each_sortary = [];
for(var name in each_stamp){
sortary.push([name, each_stamp[name] * 5]);
each_sortary.push([name, each_stamp[name] * 5]);
}
sortary.sort(function(a, b){
each_sortary.sort(function(a, b){
return b[1] - a[1];
})
console.log(sortary);
/* const stampembed = new MessageEmbed()
let each_stamp_print = "";
for(i = 0; i < each_sortary.length; i++){
each_stamp_print += each_sortary[i][0] + ': ' + each_sortary[i][1] + '% \n';
}
const stampembed = new MessageEmbed()
.setColor('#F7819F')
.setTitle(class_name)
.setDescription(class_name + '의 상위 20명 각인 정보')
.addField(
{name: "각인 상세 정보", value: }
) */
interaction.editReply('test');
.addFields(
{name: "각인 상세 정보", value: each_stamp_print, inline: true},
{name: "각인 전체 정보", value: '개발중', inline: true}
)
interaction.editReply({ embeds: [stampembed], allowedMentions: {repliedUser: false} });
})
}
}
\ No newline at end of file
......