discord-jellyfin-bot/src/app.module.ts

44 lines
1.4 KiB
TypeScript
Raw Normal View History

2022-12-15 23:57:55 +01:00
import { Module } from '@nestjs/common';
import * as Joi from 'joi';
2022-12-16 13:48:39 +01:00
import { DiscordModule } from '@discord-nestjs/core';
2022-12-15 23:57:55 +01:00
import { ConfigModule } from '@nestjs/config';
2022-12-16 13:48:39 +01:00
import { EventEmitterModule } from '@nestjs/event-emitter';
2022-12-19 11:57:04 +01:00
import { ScheduleModule } from '@nestjs/schedule';
2022-12-15 23:57:55 +01:00
2022-12-18 19:21:33 +01:00
import { DiscordConfigService } from './clients/discord/discord.config.service';
2022-12-15 23:57:55 +01:00
import { DiscordClientModule } from './clients/discord/discord.module';
import { JellyfinClientModule } from './clients/jellyfin/jellyfin.module';
2022-12-16 13:48:39 +01:00
import { CommandModule } from './commands/command.module';
2022-12-16 23:17:26 +01:00
import { PlaybackModule } from './playback/playback.module';
2022-12-19 11:57:04 +01:00
import { UpdatesModule } from './updates/updates.module';
2022-12-15 23:57:55 +01:00
@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(),
2022-12-19 11:57:04 +01:00
UPDATER_DISABLE_NOTIFICATIONS: Joi.boolean(),
2022-12-21 08:35:48 +01:00
PORT: Joi.number().min(1),
2022-12-15 23:57:55 +01:00
}),
}),
2022-12-19 11:57:04 +01:00
ScheduleModule.forRoot(),
2022-12-16 13:48:39 +01:00
DiscordModule.forRootAsync({
useClass: DiscordConfigService,
}),
DiscordModule,
2022-12-15 23:57:55 +01:00
EventEmitterModule.forRoot(),
2022-12-16 13:48:39 +01:00
CommandModule,
2022-12-15 23:57:55 +01:00
DiscordClientModule,
JellyfinClientModule,
2022-12-16 23:17:26 +01:00
PlaybackModule,
2022-12-19 11:57:04 +01:00
UpdatesModule,
2022-12-15 23:57:55 +01:00
],
2022-12-18 19:21:33 +01:00
controllers: [],
providers: [],
2022-12-15 23:57:55 +01:00
})
export class AppModule {}