Skip to content

Commit

Permalink
Update VP to fix incorrect values
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen3H committed Jan 1, 2025
1 parent 12f426b commit 19b12dd
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions aurora/common/voteparty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ export class VPHelper extends BaseHelper {
return this.#target
}

#current: number
#remaining: number
get remaining() {
return this.#remaining
}

get current() {
return this.#current
return this.target - this.#remaining
}

constructor(client: Client) {
Expand All @@ -24,10 +28,11 @@ export class VPHelper extends BaseHelper {
const info = await OfficialAPI.V3.serverInfo()

this.#target = info.voteParty.target
this.#current = info.voteParty.numRemaining // Why tf is it named 'remaining' ??
this.#remaining = info.voteParty.numRemaining

return true
} catch(_) {
} catch (err) {
console.error("Failed to initialize VPHelper:", err)
return false
}
}
Expand All @@ -37,8 +42,8 @@ export class VPHelper extends BaseHelper {
this.embed.setThumbnail('attachment://aurora.png')

this.addField("Target", `\`${this.target.toString()}\``, true)
this.addField("Current", `\`${this.#current.toString()}\``, true)
this.addField("Remaining", `\`${(this.target - this.current).toString()}\``)
this.addField("Current", `\`${this.current.toString()}\``, true)
this.addField("Remaining", `\`${this.remaining.toString()}\``)

return this.embed
}
Expand Down

0 comments on commit 19b12dd

Please sign in to comment.