Files
revanced-bots/bots/discord/src/index.ts
Palm 77fefb9bef chore: fix more build issues
BREAKING CHANGE: In `@revanced/discord-bot`, its environment variable
                 `DATABASE_URL` has been renamed to `DATABASE_PATH`
                 and the `file:` prefix is no longer needed
2024-07-08 17:48:45 +00:00

15 lines
451 B
TypeScript

import { api, discord, logger } from '$/context'
import { getMissingEnvironmentVariables } from '@revanced/bot-shared'
import './events/register'
// Check if token exists
const missingEnvs = getMissingEnvironmentVariables(['DISCORD_TOKEN', 'DATABASE_PATH'])
if (missingEnvs.length) {
for (const env of missingEnvs) logger.fatal(`${env} is not defined in environment variables`)
process.exit(1)
}
api.client.connect()
discord.client.login()