Files
revanced-bots/bots/discord/scripts/build.ts
PalmDevs 646ec8da87 feat(bots/discord): framework changes and new features
- Migrated to a new command framework which looks better and works better
- Fixed commands not being bundled correctly
- Added message (prefix) commands with argument validation
- Added a new CommandErrorType, for invalid arguments
- `/eval` is now a bit safer
- Corrected colors for the coinflip embed
- `/stop` now works even when the bot is not connected to the API
2024-07-30 21:15:36 +07:00

25 lines
642 B
TypeScript

import { createLogger } from '@revanced/bot-shared'
import { cp, rm } from 'fs/promises'
const logger = createLogger()
logger.warn('Cleaning previous build...')
await rm('./dist', { recursive: true })
logger.info('Building bot...')
await Bun.build({
entrypoints: ['./src/index.ts'],
outdir: './dist/src',
target: 'bun',
external: ['./config.js'],
minify: true,
sourcemap: 'external',
})
logger.info('Copying config...')
await cp('./config.js', './dist/config.js')
logger.info('Copying database schema...')
await cp('./.drizzle', './dist/.drizzle', { recursive: true })
await rm('./.drizzle', { recursive: true })