Skip to content

Commit

Permalink
oapi player type from npm should be usable now
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen3H committed Oct 13, 2024
1 parent cf24433 commit 7411eed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions aurora/common/resident.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,10 @@ class ResidentHelper extends BaseHelper {
const searchName = !this.dbResident ? arg1 : resName
if (ops) this.onlinePlayer = ops.find(p => p.name.toLowerCase() == searchName)

let res: V3Player
try {
// This is currently necessary bc the return type from EMC-NPM is not accurate.
const arr = await OfficialAPI.V3.players(arg1) as unknown as V3Player[]
res = arr[0]
} catch (e) {
console.log(e)
const res = await OfficialAPI.V3.players().then(arr => arr[0]).catch(e => {
console.error(e)
return false
}
})

if (res.town?.uuid) {
const resTown = await OfficialAPI.V2.town(res.town.name.toLowerCase())
Expand Down
Binary file modified bun.lockb
Binary file not shown.

0 comments on commit 7411eed

Please sign in to comment.