Reverted the last revert and actually fixed the issues with the timestamp format
This commit is contained in:
parent
ac1ff1e923
commit
65c4dbae6a
3 changed files with 4 additions and 4 deletions
|
@ -26,7 +26,7 @@ class ServerInfoCommand extends Command {
|
|||
},
|
||||
{
|
||||
"name": "🗓 **Created on:**",
|
||||
"value": new Date(this.message.channel.guild.createdAt).toString()
|
||||
"value": `<t:${Math.floor(this.message.channel.guild.createdAt / 1000)}:F>`
|
||||
},
|
||||
{
|
||||
"name": "👥 **Users:**",
|
||||
|
|
|
@ -4,7 +4,7 @@ class SnowflakeCommand extends Command {
|
|||
async run() {
|
||||
if (!this.args[0]) return "You need to provide a snowflake ID!";
|
||||
if (!this.args[0].match(/^<?[@#]?[&!]?\d+>?$/) && this.args[0] < 21154535154122752) return "That's not a valid snowflake!";
|
||||
return new Date((this.args[0].replaceAll("@", "").replaceAll("#", "").replaceAll("!", "").replaceAll("&", "").replaceAll("<", "").replaceAll(">", "") / 4194304) + 1420070400000).toUTCString();
|
||||
return `<t:${Math.floor(((this.args[0].replaceAll("@", "").replaceAll("#", "").replaceAll("!", "").replaceAll("&", "").replaceAll("<", "").replaceAll(">", "") / 4194304) + 1420070400000) / 1000)}:F>`;
|
||||
}
|
||||
|
||||
static description = "Converts a Discord snowflake id into a timestamp";
|
||||
|
|
|
@ -38,11 +38,11 @@ class UserInfoCommand extends Command {
|
|||
},
|
||||
{
|
||||
"name": "🗓️ **Joined Discord on:**",
|
||||
"value": new Date(user.createdAt).toString()
|
||||
"value": `<t:${Math.floor(user.createdAt / 1000)}:F>`
|
||||
},
|
||||
{
|
||||
"name": "💬 **Joined this server on:**",
|
||||
"value": member ? new Date(member.joinedAt).toString() : "N/A"
|
||||
"value": member ? `<t:${member.joinedAt}:F>` : "N/A"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue