aboutsummaryrefslogtreecommitdiff
path: root/src/arguments/snowflake.ts
blob: add3224168990f1ed11618e1783a97fbbcc4b70e (plain)
1
2
3
4
5
6
7
8
import { BushArgumentTypeCaster } from '@lib';
import { Snowflake } from 'discord.js';

export const snowflakeTypeCaster: BushArgumentTypeCaster = (_, phrase): Snowflake | null => {
	if (!phrase) return null;
	if (client.consts.regex.snowflake.test(phrase)) return phrase;
	return null;
};