aboutsummaryrefslogtreecommitdiff
path: root/src/arguments/snowflake.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/arguments/snowflake.ts')
-rw-r--r--src/arguments/snowflake.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/arguments/snowflake.ts b/src/arguments/snowflake.ts
new file mode 100644
index 0000000..0e6136f
--- /dev/null
+++ b/src/arguments/snowflake.ts
@@ -0,0 +1,8 @@
+import { Snowflake } from 'discord.js';
+import { BushArgumentTypeCaster } from '../lib';
+
+export const snowflakeTypeCaster: BushArgumentTypeCaster = (_, phrase): Snowflake | null => {
+ if (!phrase) return null;
+ if (client.consts.regex.snowflake.test(phrase)) return phrase;
+ return null;
+};