diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-02-04 14:40:16 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-02-04 14:40:16 -0500 |
commit | 19c0a3709156056fd092c2a43b1b47cf29f3b65f (patch) | |
tree | 8f4d3292a5b78ca0e92c14cab8229b2a37fc8dfb /src/commands | |
parent | d5d5fd6f77f2d778ab099d52f1acaad762712822 (diff) | |
download | tanzanite-19c0a3709156056fd092c2a43b1b47cf29f3b65f.tar.gz tanzanite-19c0a3709156056fd092c2a43b1b47cf29f3b65f.tar.bz2 tanzanite-19c0a3709156056fd092c2a43b1b47cf29f3b65f.zip |
remove source-map-support and moment
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/info/userInfo.ts | 26 | ||||
-rw-r--r-- | src/commands/moulberry-bush/report.ts | 23 |
2 files changed, 23 insertions, 26 deletions
diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts index 74f8185..97cdc30 100644 --- a/src/commands/info/userInfo.ts +++ b/src/commands/info/userInfo.ts @@ -118,11 +118,12 @@ export default class UserInfoCommand extends BushCommand { } private static async generateGeneralInfoField(embed: Embed, user: BushUser) { - const createdAt = util.timestamp(user.createdAt, 'd'), - createdAtDelta = util.dateDelta(user.createdAt); - // General Info - const generalInfo = [`**Mention:** <@${user.id}>`, `**ID:** ${user.id}`, `**Created:** ${createdAt} (${createdAtDelta} ago)`]; + const generalInfo = [ + `**Mention:** <@${user.id}>`, + `**ID:** ${user.id}`, + `**Created:** ${util.timestampAndDelta(user.createdAt)}` + ]; if (user.accentColor !== null) generalInfo.push(`**Accent Color:** ${user.hexAccentColor}`); if (user.banner) generalInfo.push(`**Banner:** [link](${user.bannerURL({ extension: 'png', size: 4096 })})`); @@ -136,24 +137,21 @@ export default class UserInfoCommand extends BushCommand { private static generateServerInfoField(embed: Embed, member?: BushGuildMember | undefined) { if (!member) return; - const joinedAt = util.timestamp(member?.joinedAt, 'd'), - joinedAtDelta = member.joinedAt ? util.dateDelta(member.joinedAt, 2) : undefined, - premiumSince = util.timestamp(member?.premiumSince, 'd'), - premiumSinceDelta = member.premiumSince ? util.dateDelta(member.premiumSince, 2) : undefined; - // Server User Info const serverUserInfo = []; - if (joinedAt) + if (member.joinedTimestamp) serverUserInfo.push( - `**${member.guild!.ownerId == member.user.id ? 'Created Server' : 'Joined'}:** ${joinedAt} (${joinedAtDelta} ago)` + `**${member.guild!.ownerId == member.user.id ? 'Created Server' : 'Joined'}:** ${util.timestampAndDelta( + member.joinedAt! + )}` ); - if (premiumSince) serverUserInfo.push(`**Boosting Since:** ${premiumSince} (${premiumSinceDelta} ago)`); - if (member?.displayHexColor) serverUserInfo.push(`**Display Color:** ${member.displayHexColor}`); + if (member.premiumSince) serverUserInfo.push(`**Boosting Since:** ${util.timestampAndDelta(member.premiumSince)}`); + if (member.displayHexColor) serverUserInfo.push(`**Display Color:** ${member.displayHexColor}`); if (member.user.id == '322862723090219008' && member.guild?.id == client.consts.mappings.guilds.bush) serverUserInfo.push(`**General Deletions:** 1⅓`); if ( (['384620942577369088', '496409778822709251'] as const).includes(member.user.id) && - member.guild?.id == client.consts.mappings.guilds.bush + member.guild.id == client.consts.mappings.guilds.bush ) serverUserInfo.push(`**General Deletions:** ⅓`); if (member?.nickname) serverUserInfo.push(`**Nickname:** ${util.discord.escapeMarkdown(member?.nickname)}`); diff --git a/src/commands/moulberry-bush/report.ts b/src/commands/moulberry-bush/report.ts index 7b3e729..becdeeb 100644 --- a/src/commands/moulberry-bush/report.ts +++ b/src/commands/moulberry-bush/report.ts @@ -1,9 +1,5 @@ import { AllowedMentions, BushCommand, type ArgType, type BushMessage } from '#lib'; -import assert from 'assert'; import { ApplicationCommandOptionType, Embed, PermissionFlagsBits } from 'discord.js'; -import moment from 'moment'; - -assert(moment); export default class ReportCommand extends BushCommand { public constructor() { @@ -74,18 +70,21 @@ export default class ReportCommand extends BushCommand { .setDescription(evidence) .addField({ name: 'Reporter', - value: `**Name:**${message.author.tag} <@${message.author.id}>\n**Joined:** ${moment( - message.member!.joinedTimestamp - ).fromNow()}\n**Created:** ${moment(message.author.createdTimestamp).fromNow()}\n**Sent From**: <#${ - message.channel.id - }> [Jump to context](${message.url})`, + value: [ + `**Name:**${message.author.tag} <@${message.author.id}>`, + `**Joined:** $${util.timestampAndDelta(message.member!.joinedAt!)}`, + `**Created:** ${util.timestampAndDelta(message.author.createdAt)}`, + `**Sent From**: <#${message.channel.id}> [Jump to context](${message.url})` + ].join('\n'), inline: true }) .addField({ name: 'Reported User', - value: `**Name:**${member.user.tag} <@${member.user.id}>\n**Joined:** ${moment( - member.joinedTimestamp - ).fromNow()}\n**Created:** ${moment(member.user.createdTimestamp).fromNow()}`, + value: [ + `**Name:**${member.user.tag} <@${member.user.id}>`, + `**Joined:** $${util.timestampAndDelta(member.joinedAt!)}`, + `**Created:** ${util.timestampAndDelta(member.user.createdAt)}` + ].join('\n'), inline: true }); |