a4p-bot/src/utils/isValidWebhook.ts
2024-05-12 01:15:42 -07:00

11 lines
316 B
TypeScript

import { Webhooks } from "../config/Webhooks";
/**
* Checks if the webhook ID is present in the enum.
*
* @param {string} id The ID to check.
* @returns {boolean} If the webhook ID is valid.
*/
export const isValidWebhook = (id: string): id is Webhooks =>
(Object.values(Webhooks) as string[]).includes(id);