mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-16 12:59:39 +02:00
- Add I18nService with per-user language preferences (de/en) - Add !language/!sprache command to all 4 bots (todo, calendar, contacts, clock) - Add fallback behavior: messages without commands create tasks/events/contacts/timers - Improve clock bot duration parsing to accept bare numbers as minutes (e.g. "25" = 25min) - Add support for more duration formats: "25 minuten", "1 stunde", etc. Language preferences stored in SessionService, default configurable via BOT_DEFAULT_LANGUAGE env var.
35 lines
937 B
TypeScript
35 lines
937 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import { MatrixService } from './matrix.service';
|
|
import { TodoModule } from '../todo/todo.module';
|
|
import {
|
|
TranscriptionModule,
|
|
SessionModule,
|
|
CreditModule,
|
|
TodoApiService,
|
|
I18nModule,
|
|
} from '@manacore/bot-services';
|
|
|
|
// Factory provider for TodoApiService
|
|
const todoApiServiceProvider = {
|
|
provide: TodoApiService,
|
|
useFactory: (configService: ConfigService) => {
|
|
const baseUrl = configService.get<string>('TODO_BACKEND_URL', 'http://localhost:3018');
|
|
return new TodoApiService(baseUrl);
|
|
},
|
|
inject: [ConfigService],
|
|
};
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule,
|
|
TodoModule,
|
|
TranscriptionModule.forRoot(),
|
|
SessionModule.forRoot({ storageMode: 'redis' }),
|
|
CreditModule.forRoot(),
|
|
I18nModule.forRoot(),
|
|
],
|
|
providers: [MatrixService, todoApiServiceProvider],
|
|
exports: [MatrixService],
|
|
})
|
|
export class BotModule {}
|