chore: code formatting

This commit is contained in:
github-actions[bot]
2022-11-30 04:26:03 +00:00
parent 86d4d8d384
commit bdcab18196

View File

@@ -55,7 +55,8 @@ export default async function({login, q, imports, data, account}, {enabled = fal
//Read fetched data //Read fetched data
const exported = await Promise.all( const exported = await Promise.all(
(await imports.fs.readdir(`${imports.__module(import.meta.url)}/s3si/export`)) (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) const summary = exported.filter(({type}) => type === "SUMMARY").at(0)
if (!summary) if (!summary)
throw new Error("Failed to fetch player 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, 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)), badges: await Promise.all(summary.data.HistoryRecordQuery.currentPlayer.nameplate.badges.map(badge => badge ? imports.imgb64(badge.image.url) : null)),
plate: { 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), icon: await imports.imgb64(summary.data.HistoryRecordQuery.currentPlayer.nameplate.background.image.url),
}, },
equipment: { equipment: {
@@ -105,10 +108,10 @@ export default async function({login, q, imports, data, account}, {enabled = fal
name: gear.primaryGearPower.name, name: gear.primaryGearPower.name,
icon: await imports.imgb64(gear.primaryGearPower.image.url), 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: { salmon: {
grade: { grade: {
@@ -123,7 +126,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
}, },
points: summary.data.CoopHistoryQuery.coopResult.pointCard.totalPoint, points: summary.data.CoopHistoryQuery.coopResult.pointCard.totalPoint,
kings: summary.data.CoopHistoryQuery.coopResult.pointCard.defeatBossCount, kings: summary.data.CoopHistoryQuery.coopResult.pointCard.defeatBossCount,
} },
} }
//Versus mode //Versus mode