diff --git a/TypeScript/channelType.ts b/TypeScript/channelType.ts index 752c789..ddd3f77 100644 --- a/TypeScript/channelType.ts +++ b/TypeScript/channelType.ts @@ -1,44 +1,45 @@ -/** - * This plugin checks if a channel is the specified type - * - * @author @NeoYaBoi [<@762918086349029386>] - * @version 1.0.0 - * @example - * ```ts - * import { channelType } from "../plugins/channelType"; - * import { ChannelType } from "discord.js" - * import { commandModule } from "@sern/handler"; - * export default commandModule({ - * plugins: [ channelType([ChannelType.GuildText], 'This cannot be used here') ], - * execute: (ctx) => { - * //your code here - * } - * }) - * ``` - */ -import { ChannelType } from "discord.js"; -import { CommandType, EventPlugin, PluginType } from "@sern/handler"; -export function channelType( - channelType: ChannelType[], - onFail?: string -): EventPlugin { - return { - type: PluginType.Event, - description: "Checks the channel type.", - async execute(event, controller) { - const [ctx] = event; - let channel = ctx.channel?.type; - //for some reason the dm channel type was returning undefined at some points - if (channel === undefined) { - channel = ChannelType.DM; - } - if (channelType.includes(channel)) { - return controller.next(); - } - if (onFail) { - await ctx.reply(onFail); - } - return controller.stop(); - }, - }; -} +// @ts-nocheck +/** + * This plugin checks if a channel is the specified type + * + * @author @NeoYaBoi [<@762918086349029386>] + * @version 1.0.0 + * @example + * ```ts + * import { channelType } from "../plugins/channelType"; + * import { ChannelType } from "discord.js" + * import { commandModule } from "@sern/handler"; + * export default commandModule({ + * plugins: [ channelType([ChannelType.GuildText], 'This cannot be used here') ], + * execute: (ctx) => { + * //your code here + * } + * }) + * ``` + */ +import { ChannelType } from "discord.js"; +import { CommandType, EventPlugin, PluginType } from "@sern/handler"; +export function channelType( + channelType: ChannelType[], + onFail?: string +): EventPlugin { + return { + type: PluginType.Event, + description: "Checks the channel type.", + async execute(event, controller) { + const [ctx] = event; + let channel = ctx.channel?.type; + //for some reason the dm channel type was returning undefined at some points + if (channel === undefined) { + channel = ChannelType.DM; + } + if (channelType.includes(channel)) { + return controller.next(); + } + if (onFail) { + await ctx.reply(onFail); + } + return controller.stop(); + }, + }; +}