diff --git a/.github/workflows/auto-deprecate.yml b/.github/workflows/auto-deprecate.yml index 184b927..c34f71c 100644 --- a/.github/workflows/auto-deprecate.yml +++ b/.github/workflows/auto-deprecate.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 - name: Use Node.js - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3 with: node-version: 17 registry-url: 'https://registry.npmjs.org/' diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index 336ede0..a49371c 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 - name: Set up Node.js - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3 with: node-version: 17 registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 0b2fdff..ecb366e 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -40,7 +40,7 @@ jobs: uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 - name: Set up Node.js - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3 with: node-version: 17 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 66d7a9b..76611e8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 - name: Set up Node.js - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3 with: node-version: 17 registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index b791ba8..cc00b41 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -14,7 +14,7 @@ jobs: bump-patch-for-minor-pre-major: true - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 if: ${{ steps.release.outputs.release_created }} - - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + - uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3 with: node-version: 17 registry-url: 'https://registry.npmjs.org' diff --git a/src/commands/publish.ts b/src/commands/publish.ts index c78a377..5d624c8 100644 --- a/src/commands/publish.ts +++ b/src/commands/publish.ts @@ -16,8 +16,10 @@ export async function publish(commandDir: string | undefined, args: Partial { if(s === "Guild") { - return 0 + return "0" } else if (s == "User") { - return 1 + return "1" } else { throw Error("IntegrationType is not one of Guild (0) or User (1)"); } @@ -259,7 +258,6 @@ const remoteData = { global: globalCommandsResponse, ...Object.fromEntries(guildCommandMapResponse), }; - await writeFile(resolve(cacheDir, 'command-data-remote.json'), JSON.stringify(remoteData, null, 4), 'utf8'); // TODO: add this in a verbose flag diff --git a/src/rest.ts b/src/rest.ts index c7106ff..efddc66 100644 --- a/src/rest.ts +++ b/src/rest.ts @@ -4,12 +4,12 @@ const baseURL = new URL('https://discord.com/api/v10/applications/'); const excludedKeys = new Set(['command', 'absPath']); -const publishablesIntoJson = (ps: PublishableModule[]) => - JSON.stringify( +const publishablesIntoJson = (ps: PublishableModule[]) => { + const s = JSON.stringify( ps.map((module) => module.data), - (key, value) => (excludedKeys.has(key) ? undefined : value), - 4 - ); + (key, value) => (excludedKeys.has(key) ? undefined : value), 4); + return s; +} export const create = async (token: string) => { const headers = {