Fixes for thread channels, voice commands, image handling, and snowflake, update packages

This commit is contained in:
Essem 2022-09-27 14:46:07 -05:00
parent 238f44967b
commit c70f86607f
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
18 changed files with 130 additions and 119 deletions

View file

@ -5,8 +5,10 @@ class SnowflakeCommand extends Command {
this.success = false;
if (!this.args[0]) return "You need to provide a snowflake ID!";
if (!this.args[0].match(/^<?[@#]?[&!]?\d+>?$/) && this.args[0] < 21154535154122752n) return "That's not a valid snowflake!";
const id = Math.floor(((this.args[0].replaceAll("@", "").replaceAll("#", "").replaceAll("!", "").replaceAll("&", "").replaceAll("<", "").replaceAll(">", "") / 4194304) + 1420070400000) / 1000);
if (isNaN(id)) return "That's not a valid snowflake!";
this.success = true;
return `<t:${Math.floor(((this.args[0].replaceAll("@", "").replaceAll("#", "").replaceAll("!", "").replaceAll("&", "").replaceAll("<", "").replaceAll(">", "") / 4194304) + 1420070400000) / 1000)}:F>`;
return `<t:${id}:F>`;
}
static description = "Converts a Discord snowflake id into a timestamp";