Moved formatters to seperate file
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { ChatInputCommandInteraction } from "discord.js"
|
||||
import { devMessage, embedColor } from "~/config/options.js"
|
||||
import { numberFormatter } from "~/utils/Functions/intlFormaters.js"
|
||||
import { getGuild, getHeadURL, getPlayer, getUUID } from "~/utils/Hypixel.js"
|
||||
|
||||
export default async function guildMember(interaction: ChatInputCommandInteraction): Promise<void> {
|
||||
@@ -101,13 +102,13 @@ export default async function guildMember(interaction: ChatInputCommandInteracti
|
||||
const guildRank = guildMember!.rank
|
||||
const memberGexp = guildMember!.expHistory
|
||||
const allDaysGexp = Object.keys(memberGexp).map(key => {
|
||||
return ("**➺ " + key + ":** " + "`" + new Intl.NumberFormat("en-US").format(memberGexp[key]) + "`" + "\n")
|
||||
return ("**➺ " + key + ":** " + "`" + numberFormatter.format(memberGexp[key]) + "`" + "\n")
|
||||
})
|
||||
const expValue = allDaysGexp.join("")
|
||||
const totalWeeklyGexpUnformatted = Object.values(memberGexp).reduce((a, b) => a + b, 0)
|
||||
const totalWeeklyGexp = new Intl.NumberFormat("en-US").format(totalWeeklyGexpUnformatted)
|
||||
const totalWeeklyGexp = numberFormatter.format(totalWeeklyGexpUnformatted)
|
||||
const averageWeeklyGexpUnformatted = Math.round(totalWeeklyGexpUnformatted / 7)
|
||||
const averageWeeklyGexp = new Intl.NumberFormat("en-US").format(averageWeeklyGexpUnformatted)
|
||||
const averageWeeklyGexp = numberFormatter.format(averageWeeklyGexpUnformatted)
|
||||
|
||||
const guildMemberJoinMS = guildMember!.joined
|
||||
const guildMemberJoinTime = new Date(guildMemberJoinMS)
|
||||
|
||||
Reference in New Issue
Block a user