managarten/services/matrix-todo-bot/src/bot/bot.module.ts
Till-JS 2777f604fd feat(bots): enable Redis SSO for todo-bot and calendar-bot
- Activate Redis session storage in both bots for cross-bot SSO
- Update SessionHelper to async methods for Redis-backed SessionService
- Fix async/await issues in todo-bot and calendar-bot matrix.service.ts
- Remove unused imports from calendar-api and todo-api services
- Add CALENDAR_BACKEND_URL and MANA_CORE_SERVICE_KEY to .env.development

Note: SessionService methods are now async (Redis-backed). Other bots
need their matrix.service.ts updated to await these async calls.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 14:51:23 +01:00

33 lines
900 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,
} 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(),
],
providers: [MatrixService, todoApiServiceProvider],
exports: [MatrixService],
})
export class BotModule {}