feat: detached cdn branch

This commit is contained in:
TrèsAbhi committed 2024-08-27 14:40:43 -05:00
1 parent ed041b78bb
commit 48dcbbc227
43 files changed
+267 -397

No files matched your search

+8 -3
View File
@@ -33,7 +33,7 @@ import { searchPlayersCommand } from '../../commands/searchPlayers';
import { statsCommand } from '../../commands/stats';
import { todayCommand } from '../../commands/today';
import { RenderConfiguration } from '../../core/blitzkit/renderConfiguration';
import { secrets } from '../../core/blitzkit/secrets';
import { assertSecrete } from '../../core/blitzkit/secrete';
import handleAutocomplete from './handlers/autocomplete';
import handleButton from './handlers/button';
import handleChatInputCommand from './handlers/chatInputCommand';
@@ -115,14 +115,19 @@ export const commands = Promise.allSettled(COMMANDS_RAW).then((rawCommands) => {
);
});
const rest = new REST().setToken(secrets.DISCORD_TOKEN);
const rest = new REST().setToken(assertSecrete(process.env.DISCORD_TOKEN));
commands.then((awaitedCommands) => {
const body = Object.values(awaitedCommands).map((registry) =>
registry.command.toJSON(),
);
rest.put(Routes.applicationCommands(secrets.DISCORD_CLIENT_ID), { body });
rest.put(
Routes.applicationCommands(assertSecrete(process.env.DISCORD_CLIENT_ID)),
{
body,
},
);
});
export default async function interactionCreate(