anote
1import { Context } from "telegraf";
2import MessageStore from "../service/MessageStore";
3import Parser from "./Parser";
4import { CommandFactory, Keys } from "../commands/CommandFactory";
5
6export default class Processor {
7async text(ctx: Context) {
8const parser: Parser = new Parser(ctx);
9MessageStore.setValue(parser.getMessageText());
10if(parser.isValidCommand()){
11const result: string | null = await new CommandFactory(ctx)
12.getCommand(parser.getCommandName() as Keys)
13.execute();
14if(result) {
15ctx.reply(result);
16}
17}
18}
19}