3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

use idToTimestamp method

This commit is contained in:
almeidx 2021-07-29 16:36:00 +01:00
parent 72893e7f7d
commit 35bf6e5b82
No known key found for this signature in database
GPG key ID: 8558FBFF849BD664

View file

@ -1,4 +1,4 @@
import { CategoryChannel, MessageEmbedOptions, Snowflake, SnowflakeUtil, TextChannel, VoiceChannel } from "discord.js";
import { CategoryChannel, MessageEmbedOptions, Snowflake, TextChannel, VoiceChannel } from "discord.js";
import humanizeDuration from "humanize-duration";
import { GuildPluginData } from "knub";
import moment from "moment-timezone";
@ -13,6 +13,7 @@ import {
resolveUser,
trimLines,
} from "../../../utils";
import { idToTimestamp } from "../../../utils/idToTimestamp";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
import { UtilityPluginType } from "../types";
import { getGuildPreview } from "./getGuildPreview";
@ -50,7 +51,7 @@ export async function getServerInfoEmbed(
// BASIC INFORMATION
const timeAndDate = pluginData.getPlugin(TimeAndDatePlugin);
const createdAt = moment.utc(SnowflakeUtil.deconstruct((guildPreview || restGuild)!.id).timestamp, "x");
const createdAt = moment.utc(idToTimestamp((guildPreview || restGuild)!.id)!, "x");
const tzCreatedAt = requestMemberId
? await timeAndDate.inMemberTz(requestMemberId, createdAt)
: timeAndDate.inGuildTz(createdAt);