mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:21:10 +02:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
845859cae4
commit
a336cc2381
1 changed files with 7 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue