Moved to using date locale method
This commit is contained in:
@@ -110,20 +110,7 @@ export default async function guildInfo(interaction: ChatInputCommandInteraction
|
||||
const guildExp = new Intl.NumberFormat("en-US").format(guildExpUnformatted)
|
||||
const guildLvl = guildLevel(guildExpUnformatted)
|
||||
const guildMembers = guild!.members
|
||||
|
||||
const guildCreatedDate = guildCreated.getDate()
|
||||
const guildCreatedMonth = guildCreated.getMonth() + 1
|
||||
const guildCreatedYear = guildCreated.getFullYear()
|
||||
const guildCreatedHour = guildCreated.getHours()
|
||||
const guildCreatedMinute = guildCreated.getMinutes()
|
||||
const guildCreatedSecond = guildCreated.getSeconds()
|
||||
|
||||
const guildCreatedTime = guildCreatedDate + "." +
|
||||
guildCreatedMonth + "." +
|
||||
guildCreatedYear + " " +
|
||||
guildCreatedHour + ":" +
|
||||
guildCreatedMinute + ":" +
|
||||
guildCreatedSecond
|
||||
const guildCreatedTime = guildCreated.toLocaleString("hr-HR", {})
|
||||
|
||||
const guildOwner = guildMembers.find(m => m.rank === "Guild Master")!.uuid
|
||||
const guildOwnerName = await getIGN(guildOwner)
|
||||
|
||||
@@ -111,19 +111,7 @@ export default async function guildMember(interaction: ChatInputCommandInteracti
|
||||
|
||||
const guildMemberJoinMS = guildMember!.joined
|
||||
const guildMemberJoinTime = new Date(guildMemberJoinMS)
|
||||
const guildMemberJoinDate = guildMemberJoinTime.getDate()
|
||||
const guildMemberJoinMonth = guildMemberJoinTime.getMonth() + 1
|
||||
const guildMemberJoinYear = guildMemberJoinTime.getFullYear()
|
||||
const guildMemberJoinHours = guildMemberJoinTime.getHours()
|
||||
const guildMemberJoinMinutes = guildMemberJoinTime.getMinutes()
|
||||
const guildMemberJoinSeconds = guildMemberJoinTime.getSeconds()
|
||||
|
||||
const guildMemberJoin = guildMemberJoinDate + "." +
|
||||
guildMemberJoinMonth + "." +
|
||||
guildMemberJoinYear + " " +
|
||||
guildMemberJoinHours + ":" +
|
||||
guildMemberJoinMinutes + ":" +
|
||||
guildMemberJoinSeconds
|
||||
const guildMemberJoin = guildMemberJoinTime.toLocaleString("hr-HR", {})
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { devMessage, embedColor } from "config/options.js"
|
||||
import { ChannelType, ChatInputCommandInteraction } from "discord.js"
|
||||
import { ChatInputCommandInteraction } from "discord.js"
|
||||
import { IGuildData } from "interfaces"
|
||||
import { getGuild, getIGN, getPlayer, getUUID } from "utils/Hypixel.js"
|
||||
import { redis } from "utils/Illegitimate.js"
|
||||
@@ -12,16 +12,6 @@ export default async function guildTop(interaction: ChatInputCommandInteraction)
|
||||
let amount = interaction.options.getNumber("amount") || 10
|
||||
let guild: IGuildData | null
|
||||
|
||||
if (interaction.channel!.type === ChannelType.DM) {
|
||||
interaction.editReply({
|
||||
embeds: [{
|
||||
description: "You can't use this command in DMs!",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (type === "ign") {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
|
||||
Reference in New Issue
Block a user