chore: code formatting
This commit is contained in:
@@ -55,7 +55,8 @@ export default async function({login, q, imports, data, account}, {enabled = fal
|
||||
//Read fetched data
|
||||
const exported = await Promise.all(
|
||||
(await imports.fs.readdir(`${imports.__module(import.meta.url)}/s3si/export`))
|
||||
.map(async file => JSON.parse(await imports.fs.readFile(`${imports.__module(import.meta.url)}/s3si/export/${file}`))))
|
||||
.map(async file => JSON.parse(await imports.fs.readFile(`${imports.__module(import.meta.url)}/s3si/export/${file}`))),
|
||||
)
|
||||
const summary = exported.filter(({type}) => type === "SUMMARY").at(0)
|
||||
if (!summary)
|
||||
throw new Error("Failed to fetch player summary!")
|
||||
@@ -79,7 +80,9 @@ export default async function({login, q, imports, data, account}, {enabled = fal
|
||||
byname: summary.data.HistoryRecordQuery.currentPlayer.byname,
|
||||
badges: await Promise.all(summary.data.HistoryRecordQuery.currentPlayer.nameplate.badges.map(badge => badge ? imports.imgb64(badge.image.url) : null)),
|
||||
plate: {
|
||||
color:`#${Math.round(255 * summary.data.HistoryRecordQuery.currentPlayer.nameplate.background.textColor.r).toString(16).padStart(2, 0)}${Math.round(255 * summary.data.HistoryRecordQuery.currentPlayer.nameplate.background.textColor.g).toString(16).padStart(2, 0)}${Math.round(255 * summary.data.HistoryRecordQuery.currentPlayer.nameplate.background.textColor.b).toString(16).padStart(2, 0)}`,
|
||||
color: `#${Math.round(255 * summary.data.HistoryRecordQuery.currentPlayer.nameplate.background.textColor.r).toString(16).padStart(2, 0)}${Math.round(255 * summary.data.HistoryRecordQuery.currentPlayer.nameplate.background.textColor.g).toString(16).padStart(2, 0)}${
|
||||
Math.round(255 * summary.data.HistoryRecordQuery.currentPlayer.nameplate.background.textColor.b).toString(16).padStart(2, 0)
|
||||
}`,
|
||||
icon: await imports.imgb64(summary.data.HistoryRecordQuery.currentPlayer.nameplate.background.image.url),
|
||||
},
|
||||
equipment: {
|
||||
@@ -105,10 +108,10 @@ export default async function({login, q, imports, data, account}, {enabled = fal
|
||||
name: gear.primaryGearPower.name,
|
||||
icon: await imports.imgb64(gear.primaryGearPower.image.url),
|
||||
},
|
||||
...gear.additionalGearPowers.map(async ability => ({name:ability.name, icon:await imports.imgb64(ability.image.url)}))
|
||||
])
|
||||
...gear.additionalGearPowers.map(async ability => ({name: ability.name, icon: await imports.imgb64(ability.image.url)})),
|
||||
]),
|
||||
}
|
||||
}))
|
||||
})),
|
||||
},
|
||||
salmon: {
|
||||
grade: {
|
||||
@@ -123,7 +126,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
|
||||
},
|
||||
points: summary.data.CoopHistoryQuery.coopResult.pointCard.totalPoint,
|
||||
kings: summary.data.CoopHistoryQuery.coopResult.pointCard.defeatBossCount,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
//Versus mode
|
||||
|
||||
Reference in New Issue
Block a user