mirror of
https://github.com/sern-handler/cli
synced 2026-06-06 01:16:53 +00:00
@@ -144,6 +144,7 @@ const serialize = (permissions: unknown) => {
|
|||||||
|
|
||||||
const makePublishData = ({ commandModule, config }: Record<string, Record<string, unknown>>) => {
|
const makePublishData = ({ commandModule, config }: Record<string, Record<string, unknown>>) => {
|
||||||
const applicationType = intoApplicationType(commandModule.type as number);
|
const applicationType = intoApplicationType(commandModule.type as number);
|
||||||
|
console.log(config)
|
||||||
return {
|
return {
|
||||||
data: {
|
data: {
|
||||||
name: commandModule.name as string,
|
name: commandModule.name as string,
|
||||||
@@ -153,6 +154,19 @@ const makePublishData = ({ commandModule, config }: Record<string, Record<string
|
|||||||
options: optionsTransformer((commandModule?.options ?? []) as Typeable[]),
|
options: optionsTransformer((commandModule?.options ?? []) as Typeable[]),
|
||||||
dm_permission: config?.dmPermission,
|
dm_permission: config?.dmPermission,
|
||||||
default_member_permissions: serialize(config?.defaultMemberPermissions),
|
default_member_permissions: serialize(config?.defaultMemberPermissions),
|
||||||
|
//@ts-ignore
|
||||||
|
integration_types: (config?.integrationTypes ?? ['Guild']).map(
|
||||||
|
(s: string) => {
|
||||||
|
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,
|
config,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -53,6 +53,14 @@ program //
|
|||||||
.option('-y, --yes', "Say yes to all prompts")
|
.option('-y, --yes', "Say yes to all prompts")
|
||||||
.option('-e, --env [path]', "Supply a path to a .env")
|
.option('-e, --env [path]', "Supply a path to a .env")
|
||||||
.action(async (...args) => importDynamic('command-clear.js').then((m) => m.commandClear(...args))));
|
.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
|
program
|
||||||
.command('build')
|
.command('build')
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export async function getConfig(): Promise<sernConfig> {
|
|||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface sernConfig {
|
export interface sernConfig {
|
||||||
language: 'typescript' | 'javascript';
|
language: 'typescript' | 'javascript';
|
||||||
defaultPrefix?: string;
|
defaultPrefix?: string;
|
||||||
@@ -20,5 +19,21 @@ export interface sernConfig {
|
|||||||
commands: string;
|
commands: string;
|
||||||
events?: 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[];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user