Skip to content

Commit

Permalink
fix sern build option
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoobes committed Apr 11, 2024
1 parent 504331d commit 715f373
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 30 deletions.
5 changes: 3 additions & 2 deletions src/create-publish.mts
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ appid && console.warn(`${magentaBright('WARNING')}: APPLICATION_ID is not necess
// partition globally published and guilded commands
const [globalCommands, guildedCommands] = publishableData.reduce(
([globals, guilded], module) => {
const isPublishableGlobally = !module.config || !Array.isArray(module.config.guildIds);
const isPublishableGlobally = !Array.isArray(module.config?.guildIds);
if (isPublishableGlobally) {
console.log(module)
return [[module, ...globals], guilded];
}
return [globals, [module, ...guilded]];
Expand All @@ -200,10 +201,10 @@ const res = await rest.updateGlobal(globalCommands);

let globalCommandsResponse: unknown;


if (res.ok) {
globalCommands.length && spin.succeed(`All ${cyanBright('Global')} commands published`);
globalCommandsResponse = await res.json();
console.log(globalCommandsResponse)
} else {
spin.fail(`Failed to publish global commands [Code: ${redBright(res.status)}]`);
let err: Error
Expand Down
12 changes: 1 addition & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ program //
.description('New way to manage your slash commands')
.option('-W --suppress-warnings', 'suppress experimental warning')
.option('-i, --import [scriptPath...]', 'Prerequire a script to load into publisher')
.option('-t, --token [token]')
.option('--appId [applicationId]')
.option('-e --env', 'path to .env file')
.argument('[path]', 'path with respect to current working directory that will locate all published files')
.action(async (...args) => importDynamic('publish.js').then((m) => m.publish(...args)))
).addCommand(
Expand All @@ -53,15 +52,6 @@ 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')
.description('Build your bot')
Expand Down
17 changes: 0 additions & 17 deletions src/utilities/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,4 @@ export interface sernConfig {
commands: string;
events?: 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[];
}
}

0 comments on commit 715f373

Please sign in to comment.