diff --git a/TypeScript/publish.ts b/TypeScript/publish.ts index a108e25..fa37c39 100644 --- a/TypeScript/publish.ts +++ b/TypeScript/publish.ts @@ -23,6 +23,7 @@ import { controller, SernOptionsData, SlashCommand, + Service, } from "@sern/handler"; import { ApplicationCommandData, @@ -30,7 +31,6 @@ import { ApplicationCommandOptionType, PermissionResolvable, } from "discord.js"; -import { useContainer } from "../index.js"; export const CommandTypeRaw = { [CommandType.Both]: ApplicationCommandType.ChatInput, @@ -48,7 +48,13 @@ export function publish< >(options?: PublishOptions) { return CommandInitPlugin(async ({ module }) => { // Users need to provide their own useContainer function. - const [client] = useContainer("@sern/client"); + let client; + try { + client = (await import('@sern/handler')).Service('@sern/client') + } catch { + const { useContainer } = await import('../index.js') + client = useContainer("@sern/client")[0]; + } const defaultOptions = { guildIds: [], dmPermission: undefined,