aboutsummaryrefslogtreecommitdiff
path: root/src/arguments/snowflake.ts
blob: 03d78c26f782138ceb0684229f7c1ee18c039986 (plain)
1
2
3
4
5
6
7
8
import { type BushArgumentTypeCaster } from '#lib';
import { type 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;
};