discord-jellyfin-bot/src/app.module.ts
2022-12-18 12:17:33 +01:00

40 lines
1.3 KiB
TypeScript

import { Module } from '@nestjs/common';
import * as Joi from 'joi';
import { DiscordModule } from '@discord-nestjs/core';
import { ConfigModule } from '@nestjs/config';
import { EventEmitterModule } from '@nestjs/event-emitter';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { DiscordClientModule } from './clients/discord/discord.module';
import { JellyfinClientModule } from './clients/jellyfin/jellyfin.module';
import { CommandModule } from './commands/command.module';
import { DiscordConfigService } from './clients/discord/discord.config.service';
import { PlaybackModule } from './playback/playback.module';
@Module({
imports: [
ConfigModule.forRoot({
validationSchema: Joi.object({
DISCORD_CLIENT_TOKEN: Joi.string().required(),
JELLYFIN_SERVER_ADDRESS: Joi.string().required(),
JELLYFIN_AUTHENTICATION_USERNAME: Joi.string().required(),
JELLYFIN_AUTHENTICATION_PASSWORD: Joi.string().required(),
}),
}),
DiscordModule.forRootAsync({
useClass: DiscordConfigService,
}),
DiscordModule,
EventEmitterModule.forRoot(),
CommandModule,
DiscordClientModule,
JellyfinClientModule,
PlaybackModule,
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}