From a336cc23814b2e75ed0c92960fba71c5398dccd2 Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Tue, 17 Feb 2026 14:14:07 +0100 Subject: [PATCH] fix(nutriphi-bot): make I18nService optional to fix DI error Same fix as planta-bot - I18nService injection was failing because the service couldn't be resolved in the BotModule context despite I18nModule having global: true. Co-Authored-By: Claude Opus 4.5 --- .../matrix-nutriphi-bot/src/bot/matrix.service.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/services/matrix-nutriphi-bot/src/bot/matrix.service.ts b/services/matrix-nutriphi-bot/src/bot/matrix.service.ts index 89a26c87d..8100f6c40 100644 --- a/services/matrix-nutriphi-bot/src/bot/matrix.service.ts +++ b/services/matrix-nutriphi-bot/src/bot/matrix.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@nestjs/common'; +import { Injectable, Optional } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { BaseMatrixService, @@ -46,7 +46,7 @@ const keywordDetector = new KeywordCommandDetector([ export class MatrixService extends BaseMatrixService implements CreditCommandsHost { // Expose services for credit commands mixin public creditService: CreditService; - public i18nService: I18nService; + public i18nService!: I18nService; public sessionService: SessionService; constructor( @@ -55,14 +55,16 @@ export class MatrixService extends BaseMatrixService implements CreditCommandsHo sessionService: SessionService, private transcriptionService: TranscriptionService, creditService: CreditService, - i18nService: I18nService, - private mediaService: MediaService + private mediaService: MediaService, + @Optional() i18nService?: I18nService ) { super(configService); // Assign to public properties for credit commands mixin this.sessionService = sessionService; this.creditService = creditService; - this.i18nService = i18nService; + if (i18nService) { + this.i18nService = i18nService; + } } // ============================================================================