diff --git a/src/client/typescript/main.ts b/src/client/typescript/main.ts index 65edec4..33ed312 100644 --- a/src/client/typescript/main.ts +++ b/src/client/typescript/main.ts @@ -1,3 +1,6 @@ +import { Channel } from "discord.js"; +import prisma from "../../../generated/prisma"; + // Preline: necessary for header events. window.addEventListener("load", () => { const inputs = document.querySelectorAll('.dt-container thead input'); @@ -33,4 +36,10 @@ export const formatTimestamp = (timestamp: string | number) => { return now.getFullYear() === date.getFullYear() ? result + `, ${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}` : result + ` ${date.getFullYear()}`; -} \ No newline at end of file +} + +export const verifyChannels = (data: prisma.Channel[], channels: Channel[]) => { + return data.some(item => { + return channels.map(channel => channel.id).includes(item.channel_id); + }); +}; \ No newline at end of file