aboutsummaryrefslogtreecommitdiff
path: root/src/arguments/snowflake.ts
blob: 0e6136f1c5e19922e52080baa85f52dd6df1a065 (plain)
1
2
3
4
5
6
7
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;
};