tgd-backend/src/game/event-handlers/quiz-answered-event.handler.ts
2024-10-30 18:56:48 +04:00

15 lines
582 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { CommandBus, EventBus, EventsHandler, IEventHandler } from '@nestjs/cqrs';
import { HideKeyboardCommand } from '../commands/hide-keyboard.command';
import { QuizAnsweredEvent } from '../events/quiz.answered';
@EventsHandler(QuizAnsweredEvent)
export class QuizAnsweredEventHandler
implements IEventHandler<QuizAnsweredEvent>
{
constructor(private eventBus: EventBus, private commandBus: CommandBus) {
}
async handle(event: QuizAnsweredEvent) {
// await this.commandBus.execute(new HideKeyboardCommand(`На вопрос ответил: ${event.name}`));
}
}