diff --git a/plugins/helpers/mod.ts b/plugins/helpers/mod.ts index f26209a97..a85c32b55 100644 --- a/plugins/helpers/mod.ts +++ b/plugins/helpers/mod.ts @@ -21,7 +21,9 @@ import { fetchAndRetrieveMembers } from "./src/fetchAndRetrieveMembers.ts"; import { BotWithCache } from "../cache/src/addCacheCollections.ts"; import { sendTextMessage } from "./src/sendTextMessage.ts"; -export interface BotWithHelpersPlugin extends Bot { +export type BotWithHelpersPlugin = Omit & HelperFunctionsFromHelperPlugin; + +export interface HelperFunctionsFromHelperPlugin { helpers: FinalHelpers & { fetchAndRetrieveMembers: ( guildId: bigint, @@ -72,8 +74,9 @@ export interface BotWithHelpersPlugin extends Bot { }; } -export function enableHelpersPlugin(rawBot: Bot): BotWithHelpersPlugin { - const bot = rawBot as BotWithHelpersPlugin; +export function enableHelpersPlugin(rawBot: B): BotWithHelpersPlugin { + // FORCE OVERRIDE THE TYPE SO WE CAN SETUP FUNCTIONS + const bot = rawBot as unknown as BotWithHelpersPlugin; bot.helpers.fetchAndRetrieveMembers = ( guildId: bigint, @@ -113,7 +116,7 @@ export function enableHelpersPlugin(rawBot: Bot): BotWithHelpersPlugin { channelId: bigint, ) => moveMember(bot, guildId, memberId, channelId); - return bot as BotWithHelpersPlugin; + return bot as BotWithHelpersPlugin; } // EXPORT EVERYTHING HERE SO USERS CAN OPT TO USE FUNCTIONS DIRECTLY