skins fix

This commit is contained in:
milo
2025-05-04 16:37:05 +02:00
parent ef2d1c1774
commit 0dd2deb84e

View File

@@ -1248,18 +1248,19 @@ app.post('/interactions', verifyKeyMiddleware(process.env.PUBLIC_KEY), async fun
const topSkins = getTopSkins.all()
const guild = await client.guilds.fetch(req.body.guild_id)
console.log(topSkins)
let fields = []
topSkins.forEach((skin, index) => {
const owner = guild.members.fetch(skin.user_id);
for (const skin of topSkins) {
const index = topSkins.indexOf(skin);
const owner = await guild.members.fetch(skin.user_id);
console.log('owner:')
console.log(owner)
fields.push({
name: `#${index+1} - **${skin.displayName}**`,
value: `${skin.maxPrice}${skin.user_id ? '| **@'+ owner.user.username+'** ✅' : ''}\n`,
inline: false
});
})
}
return res.send({
type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE,