Fixes for thread channels, voice commands, image handling, and snowflake, update packages
This commit is contained in:
parent
238f44967b
commit
c70f86607f
18 changed files with 130 additions and 119 deletions
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue