From 38c06997b4d0f7bb3f1e62618a5e3f088c522e30 Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Sun, 28 Jul 2024 21:14:07 +0700 Subject: [PATCH] fix(bots/discord): cross-device link build errors --- bots/discord/scripts/build.ts | 5 +++-- bots/discord/src/context.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bots/discord/scripts/build.ts b/bots/discord/scripts/build.ts index 9fb15d6..ed335c7 100644 --- a/bots/discord/scripts/build.ts +++ b/bots/discord/scripts/build.ts @@ -17,7 +17,8 @@ await Bun.build({ }) logger.info('Copying config...') -await cp('config.js', 'dist/config.js') +await cp('./config.js', './dist/config.js') logger.info('Copying database schema...') -await rename('.drizzle', 'dist/.drizzle') +await cp('./.drizzle', './dist/.drizzle', { recursive: true }) +await rm('./.drizzle', { recursive: true }) diff --git a/bots/discord/src/context.ts b/bots/discord/src/context.ts index 915df97..2644af6 100644 --- a/bots/discord/src/context.ts +++ b/bots/discord/src/context.ts @@ -13,7 +13,7 @@ export { config } import * as commands from './commands' import * as schemas from './database/schemas' -import type Command from './classes/Command' +import type { Command } from './commands/types' export const logger = createLogger({ level: config.logLevel === 'none' ? Number.MAX_SAFE_INTEGER : config.logLevel, @@ -81,7 +81,7 @@ export const discord = { }, partials: [Partials.Message, Partials.Reaction], }), - commands: Object.fromEntries(Object.values(commands).map(cmd => [cmd.name, cmd])) as Record< + commands: Object.fromEntries(Object.values(commands).map(cmd => [cmd.data.name, cmd])) as Record< string, Command >,