diff --git a/src/create-publish.mts b/src/create-publish.mts index fbb62e5..28e2cb8 100644 --- a/src/create-publish.mts +++ b/src/create-publish.mts @@ -144,6 +144,7 @@ const serialize = (permissions: unknown) => { const makePublishData = ({ commandModule, config }: Record>) => { const applicationType = intoApplicationType(commandModule.type as number); + console.log(config) return { data: { name: commandModule.name as string, @@ -153,6 +154,19 @@ const makePublishData = ({ commandModule, config }: Record { + if(s === "Guild") { + return 0 + } else if (s == "User") { + return 1 + } else { + throw Error("IntegrationType is not one of Guild or User"); + } + }), + //@ts-ignore + contexts: config?.contexts ? config.contexts : undefined }, config, }; diff --git a/src/index.ts b/src/index.ts index 0c58b01..a5d1781 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,6 +53,14 @@ program // .option('-y, --yes', "Say yes to all prompts") .option('-e, --env [path]', "Supply a path to a .env") .action(async (...args) => importDynamic('command-clear.js').then((m) => m.commandClear(...args)))); +program + .command('app') + .description('manage your discord application') + .addCommand( + new Command('update') + .description("Refresh your discord application.") + .option('-W --suppress-warnings', 'suppress experimental warning') + .action(async (...args) => importDynamic('app-update.js').then(m => m.appUpdate(...args)))) program .command('build') diff --git a/src/utilities/getConfig.ts b/src/utilities/getConfig.ts index ff44033..fee0886 100644 --- a/src/utilities/getConfig.ts +++ b/src/utilities/getConfig.ts @@ -11,7 +11,6 @@ export async function getConfig(): Promise { return output; } - export interface sernConfig { language: 'typescript' | 'javascript'; defaultPrefix?: string; @@ -20,5 +19,21 @@ export interface sernConfig { commands: string; events?: string; }; - buildPath: string; + app?: { + customInstallUrl?: string; + description?: string; + roleConnectionsVerificationUrl?: string; + installParams?: { + type: 'install params object'; + }; + integrationTypesConfig?: { + type: 'dictionary with keys of application integration types'; + description: 'In preview. Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object'; + }; + flags?: number; + icon?: '?image data'; + coverImage?: '?image data'; + interactionsEndpointUrl?: string; + tags: string[]; + } }