diff --git a/.github/workflows/host.yml b/.github/workflows/host.yml index ab564b9c1..d637da4f6 100644 --- a/.github/workflows/host.yml +++ b/.github/workflows/host.yml @@ -35,4 +35,4 @@ jobs: unzip dist.zip - name: Run index.cjs - run: NODE_ENV=production DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} WARGAMING_APPLICATION_ID=${{ secrets.WARGAMING_APPLICATION_ID }} node --enable-source-maps index.cjs + run: NODE_ENV=production DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} WARGAMING_APPLICATION_ID=${{ secrets.WARGAMING_APPLICATION_ID }} node --enable-source-maps --trace-warnings index.cjs diff --git a/.gitignore b/.gitignore index 7702a7f6d..38cfabf71 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ package-lock.json /playwright/.cache/ dist/ yarn-error.log -dist.zip \ No newline at end of file +dist.zip +commands.txt \ No newline at end of file diff --git a/scripts/build.js b/scripts/build.js index 64d95a31f..70ee2d8f3 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -19,9 +19,11 @@ build({ '.ttf': 'file', }, - bundle: isProd, + bundle: true, sourcemap: isProd, minifyIdentifiers: false, // causes errors minifySyntax: isProd, minifyWhitespace: isProd, + + logLevel: isProd ? 'info' : 'silent', }); diff --git a/src/commands/today.tsx b/src/commands/today.tsx index 34fe10b29..681b4ee1d 100644 --- a/src/commands/today.tsx +++ b/src/commands/today.tsx @@ -27,7 +27,7 @@ import { PlayerClanData } from '../types/playerClanData.js'; export default { inProduction: true, - inDevelopment: false, + inDevelopment: true, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts index dc71678e3..047a38ad3 100644 --- a/src/events/interactionCreate.ts +++ b/src/events/interactionCreate.ts @@ -146,7 +146,17 @@ export default async function interactionCreate( return; } - console.log(interaction.toString()); + const metadata = [ + `${interaction.user.id} (${interaction.user.username})`, + `${interaction.guildId}/${interaction.channelId} (${interaction.guild?.name})`, + new Date(), + ]; + + console.log( + `${interaction.toString()}\n${metadata + .map((item) => ` ${item}`) + .join('\n')}`, + ); await interaction.deferReply(); try {