Skip to content

Commit

Permalink
remove deprecated application id option for publish
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoobes committed Apr 11, 2024
1 parent d94d5de commit c90003e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
6 changes: 0 additions & 6 deletions src/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export async function publish(commandDir: string | undefined, args: Partial<Publ
// assign args.import to empty array if non existent
args.import ??= [];

args.token && console.info('Token passed through command line');
args.applicationId && console.info(magentaBright('WARNING')+ ' This option is deprecated. Do not pass applicationId through command line');
commandDir && console.info('Publishing with override path: ', commandDir);

const dotenvLocation = new URL('../node_modules/dotenv/config.js', rootPath),
Expand All @@ -25,10 +23,6 @@ export async function publish(commandDir: string | undefined, args: Partial<Publ
// loader flag to require typescript files
const command = fork(fileURLToPath(publishScript), [], {
execArgv: ['--loader', esmLoader.toString(), '-r', fileURLToPath(dotenvLocation), '--no-warnings'],
env: {
token: args.token ?? '',
applicationId: args.applicationId ?? '',
},
});
// send paths object so we dont have to recalculate it in script
command.send({ config, preloads: args.import, commandDir });
Expand Down
7 changes: 2 additions & 5 deletions src/create-publish.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { once } from 'node:events';
import * as Rest from './rest';
import type { sernConfig } from './utilities/getConfig';
import type { PublishableData, PublishableModule, Typeable } from './create-publish.d.ts';
import { cyanBright, greenBright, magentaBright, redBright } from 'colorette';
import { cyanBright, greenBright, redBright } from 'colorette';
import { inspect } from 'node:util'
import ora from 'ora';

Expand Down Expand Up @@ -144,7 +144,6 @@ const serialize = (permissions: unknown) => {

const makePublishData = ({ commandModule, config }: Record<string, Record<string, unknown>>) => {
const applicationType = intoApplicationType(commandModule.type as number);
console.log(config)
return {
data: {
name: commandModule.name as string,
Expand Down Expand Up @@ -174,11 +173,9 @@ const makePublishData = ({ commandModule, config }: Record<string, Record<string

// We can use these objects to publish to DAPI
const publishableData = modules.map(makePublishData),
token = process.env.token || process.env.DISCORD_TOKEN,
appid = process.env.applicationId || process.env.APPLICATION_ID;
token = process.env.token || process.env.DISCORD_TOKEN;

assert(token, 'Could not find a token for this bot in .env or commandline. Do you have DISCORD_TOKEN in env?');
appid && console.warn(`${magentaBright('WARNING')}: APPLICATION_ID is not necessary anymore`);
// partition globally published and guilded commands
const [globalCommands, guildedCommands] = publishableData.reduce(
([globals, guilded], module) => {
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ program //
.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]')
.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 Down

0 comments on commit c90003e

Please sign in to comment.