mirror of
https://github.com/hexastack/hexabot
synced 2025-03-12 15:12:08 +00:00
fix: ts issue
This commit is contained in:
parent
f26a97f763
commit
7b275c40f4
@ -6,7 +6,7 @@
|
|||||||
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
|
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Transform, Type } from 'class-transformer';
|
import { Transform, Type } from 'class-transformer';
|
||||||
import { Schema as MongooseSchema } from 'mongoose';
|
import { Schema as MongooseSchema } from 'mongoose';
|
||||||
|
|
||||||
|
@ -8,8 +8,9 @@
|
|||||||
|
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { OnEvent } from '@nestjs/event-emitter';
|
import { OnEvent } from '@nestjs/event-emitter';
|
||||||
|
import { THydratedDocument } from 'mongoose';
|
||||||
|
|
||||||
import { AnyMessage } from '@/chat/schemas/types/message';
|
import { Message } from '@/chat/schemas/message.schema';
|
||||||
import { Language } from '@/i18n/schemas/language.schema';
|
import { Language } from '@/i18n/schemas/language.schema';
|
||||||
import { LanguageService } from '@/i18n/services/language.service';
|
import { LanguageService } from '@/i18n/services/language.service';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
@ -67,7 +68,7 @@ export class NlpSampleService extends BaseService<
|
|||||||
}
|
}
|
||||||
|
|
||||||
@OnEvent('hook:message:preCreate')
|
@OnEvent('hook:message:preCreate')
|
||||||
async handleNewMessage(doc: AnyMessage) {
|
async handleNewMessage(doc: THydratedDocument<Message>) {
|
||||||
// If message is sent by the user then add it as an inbox sample
|
// If message is sent by the user then add it as an inbox sample
|
||||||
if (
|
if (
|
||||||
'sender' in doc &&
|
'sender' in doc &&
|
||||||
|
Loading…
Reference in New Issue
Block a user