diff --git a/.github/workflows/cd-host.yml b/.github/workflows/cd-host.yml index db3545e5f..3fb00f6ba 100644 --- a/.github/workflows/cd-host.yml +++ b/.github/workflows/cd-host.yml @@ -31,4 +31,4 @@ jobs: unzip bot.zip -d dist/bot - name: Run bot - run: mv dist/bot/prisma . && mv dist/bot/node_modules . && mv dist/bot/package.json . && mv dist/bot/.env . && GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DATABASE_URL=${{ secrets.DATABASE_URL }} NODE_ENV=production bun dist/bot/index.js --production + run: mv dist/bot/prisma . && mv dist/bot/node_modules . && mv dist/bot/package.json . && mv dist/bot/.env . && GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DATABASE_URL=${{ secrets.DATABASE_URL }} DISCORD_CLIENT_ID=${{ secrets.DISCORD_CLIENT_ID }} bun dist/bot/index.js --production diff --git a/bot.env b/bot.env deleted file mode 100644 index 995fca4af..000000000 --- a/bot.env +++ /dev/null @@ -1 +0,0 @@ -NODE_ENV=production \ No newline at end of file diff --git a/discord.json b/discord.json deleted file mode 100644 index 4420687dc..000000000 --- a/discord.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "client_id": "1097673957865443370", - "client_id_dev": "1099063696015229078" -} diff --git a/src/core/blitzkit/getClientId.ts b/src/core/blitzkit/getClientId.ts deleted file mode 100644 index 4f292d07e..000000000 --- a/src/core/blitzkit/getClientId.ts +++ /dev/null @@ -1,6 +0,0 @@ -import discord from '../../../discord.json' assert { type: 'json' }; -import isDev from './isDev'; - -export default function getClientId() { - return isDev() ? discord.client_id_dev : discord.client_id; -} diff --git a/src/core/blitzkit/secrets.ts b/src/core/blitzkit/secrets.ts index de08e3377..78e939edd 100644 --- a/src/core/blitzkit/secrets.ts +++ b/src/core/blitzkit/secrets.ts @@ -4,6 +4,7 @@ config(); const SECRET_KEYS = [ 'DISCORD_TOKEN', + 'DISCORD_CLIENT_ID', 'GH_TOKEN', 'DATABASE_URL', 'WOTB_DLC_CDN', diff --git a/src/events/interactionCreate/index.ts b/src/events/interactionCreate/index.ts index bf591d55a..1ec8f5418 100644 --- a/src/events/interactionCreate/index.ts +++ b/src/events/interactionCreate/index.ts @@ -32,7 +32,6 @@ import { searchClansCommand } from '../../commands/searchClans'; import { searchPlayersCommand } from '../../commands/searchPlayers'; import { statsCommand } from '../../commands/stats'; import { todayCommand } from '../../commands/today'; -import getClientId from '../../core/blitzkit/getClientId'; import isDev from '../../core/blitzkit/isDev'; import { RenderConfiguration } from '../../core/blitzkit/renderConfiguration'; import { secrets } from '../../core/blitzkit/secrets'; @@ -124,7 +123,7 @@ commands.then((awaitedCommands) => { registry.command.toJSON(), ); - rest.put(Routes.applicationCommands(getClientId()), { body }); + rest.put(Routes.applicationCommands(secrets.DISCORD_CLIENT_ID), { body }); }); export default async function interactionCreate(