2019-11-05 15:52:46 +00:00
|
|
|
exports.run = async (message, args) => {
|
2020-01-07 15:38:13 +00:00
|
|
|
if (!args[0]) return `${message.author.mention}, you need to provide a snowflake ID!`;
|
2020-04-10 02:40:52 +00:00
|
|
|
if (!args[0].match(/^<?[@#]?[&!]?\d+>?$/) && args[0] < 21154535154122752) return `${message.author.mention}, that's not a valid snowflake!`;
|
2021-01-18 20:11:28 +00:00
|
|
|
return new Date((args[0].replaceAll("@", "").replaceAll("#", "").replaceAll("!", "").replaceAll("&", "").replaceAll("<", "").replaceAll(">", "") / 4194304) + 1420070400000).toUTCString();
|
2019-11-05 15:52:46 +00:00
|
|
|
};
|
|
|
|
|
2019-12-02 20:47:22 +00:00
|
|
|
exports.aliases = ["timestamp", "snowstamp", "snow"];
|
|
|
|
exports.category = 1;
|
2019-12-05 16:58:46 +00:00
|
|
|
exports.help = "Converts a Discord snowflake id into a timestamp";
|
|
|
|
exports.params = "[id]";
|