From e2cf582b9fd15d0ec09e1455de96b0dd843b170a Mon Sep 17 00:00:00 2001 From: Kirill Ivlev Date: Wed, 13 Nov 2024 19:03:59 +0400 Subject: [PATCH] don't show keyboard after card selection --- .../command/remove-card-from-user.handler.ts | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/guests/command/remove-card-from-user.handler.ts b/src/guests/command/remove-card-from-user.handler.ts index 5505a3d..b1f07cf 100644 --- a/src/guests/command/remove-card-from-user.handler.ts +++ b/src/guests/command/remove-card-from-user.handler.ts @@ -20,36 +20,36 @@ export class RemoveCardFromUserCommandHandler implements ICommandHandler { - const guest = await this.guestService.findById(command.telegramId); - const data = await this.sharedService.getConfig(`buttons_${command.telegramId}`); - const extra = { - reply_markup: { - remove_keyboard: false, - keyboard: [], - }, - }; - const buttons = JSON.parse(data.value); - let found = false; - buttons.reply_markup.keyboard.forEach((item) => { - if (item[0].text.includes(command.card.description) && !found) { - found = true; - } else { - extra.reply_markup.keyboard.push( - [ { ...item[0] } ] - ) - } - }); - if (extra.reply_markup.keyboard.length === 0) { - extra.reply_markup.remove_keyboard = true; - } - await this.sharedService.setConfig(`buttons_${command.telegramId}`, JSON.stringify(extra)); - this.telegramService.emit({ - cmd: CommandsConsts.SendMessage, - }, { - chatId: guest.chatId, - message: Messages.SELECT_CARD, - extra: extra, - }) + // const guest = await this.guestService.findById(command.telegramId); + // const data = await this.sharedService.getConfig(`buttons_${command.telegramId}`); + // const extra = { + // reply_markup: { + // remove_keyboard: false, + // keyboard: [], + // }, + // }; + // const buttons = JSON.parse(data.value); + // let found = false; + // buttons.reply_markup.keyboard.forEach((item) => { + // if (item[0].text.includes(command.card.description) && !found) { + // found = true; + // } else { + // extra.reply_markup.keyboard.push( + // [ { ...item[0] } ] + // ) + // } + // }); + // if (extra.reply_markup.keyboard.length === 0) { + // extra.reply_markup.remove_keyboard = true; + // } + // await this.sharedService.setConfig(`buttons_${command.telegramId}`, JSON.stringify(extra)); + // this.telegramService.emit({ + // cmd: CommandsConsts.SendMessage, + // }, { + // chatId: guest.chatId, + // message: Messages.SELECT_CARD, + // extra: extra, + // }) } } \ No newline at end of file