mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
feat: centrelize eventEmitter
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { InjectModel } from '@nestjs/mongoose';
|
||||
import { Model } from 'mongoose';
|
||||
|
||||
@@ -17,11 +16,8 @@ import { BotStats, BotStatsType } from '../schemas/bot-stats.schema';
|
||||
|
||||
@Injectable()
|
||||
export class BotStatsRepository extends BaseRepository<BotStats> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
@InjectModel(BotStats.name) readonly model: Model<BotStats>,
|
||||
) {
|
||||
super(eventEmitter, model, BotStats);
|
||||
constructor(@InjectModel(BotStats.name) readonly model: Model<BotStats>) {
|
||||
super(model, BotStats);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { EventEmitter2, OnEvent } from '@nestjs/event-emitter';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
|
||||
import { Subscriber } from '@/chat/schemas/subscriber.schema';
|
||||
import { config } from '@/config';
|
||||
@@ -21,7 +21,6 @@ import { BotStats, BotStatsType } from '../schemas/bot-stats.schema';
|
||||
export class BotStatsService extends BaseService<BotStats> {
|
||||
constructor(
|
||||
readonly repository: BotStatsRepository,
|
||||
private readonly eventEmitter: EventEmitter2,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
super(repository);
|
||||
|
||||
Reference in New Issue
Block a user