From f0be3655a79bc54ed462f112962110db2cf7e0a5 Mon Sep 17 00:00:00 2001 From: Taken Date: Thu, 26 Sep 2024 15:25:52 +0200 Subject: [PATCH] Moved to using date locale method --- src/commands/guild/info.ts | 15 +-------------- src/commands/guild/member.ts | 14 +------------- src/commands/guild/top.ts | 12 +----------- 3 files changed, 3 insertions(+), 38 deletions(-) diff --git a/src/commands/guild/info.ts b/src/commands/guild/info.ts index 54a1e91..e88e564 100644 --- a/src/commands/guild/info.ts +++ b/src/commands/guild/info.ts @@ -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) diff --git a/src/commands/guild/member.ts b/src/commands/guild/member.ts index f6fe578..e720e50 100644 --- a/src/commands/guild/member.ts +++ b/src/commands/guild/member.ts @@ -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: [{ diff --git a/src/commands/guild/top.ts b/src/commands/guild/top.ts index b81f541..32876e9 100644 --- a/src/commands/guild/top.ts +++ b/src/commands/guild/top.ts @@ -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: [{