From 8cb5e30c6170064086e84c3f1bb6f6a35616a2cd Mon Sep 17 00:00:00 2001 From: GiovaniFZ Date: Sun, 2 Jun 2024 17:06:00 -0300 Subject: [PATCH] Hide keyboard and send message --- commands/customize.js | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/commands/customize.js b/commands/customize.js index 3577e84..d0dd4c6 100644 --- a/commands/customize.js +++ b/commands/customize.js @@ -11,11 +11,43 @@ module.exports = function(bot, msg) { [{text: 'She/Her'}], [{text: 'They/Them'}], ], - } + }, + parse_mode: 'Markdown' }; const message = "Select your pronouns:"; + const message2 = "You selected He/Him"; + const message3 = "You selected She/Her"; + const message4 = "You selected They/Them"; - bot.sendMessage(chatId, message, opts,{ parse_mode: 'Markdown' }) + bot.sendMessage(chatId, message, opts) .catch(error => console.error('WARN: Message cannot be sent: ', error)); + + bot.onText('He/Him', (msg) => { + bot.sendMessage(msg.chat.id, message2, { + reply_markup: { + remove_keyboard: true + } + }) + .catch(error => console.error('WARN: Message cannot be sent: ', error)); +}); + +bot.onText('She/Her', (msg) => { + bot.sendMessage(msg.chat.id, message3, { + reply_markup: { + remove_keyboard: true + } + }) + .catch(error => console.error('WARN: Message cannot be sent: ', error)); +}); + +bot.onText('They/Them', (msg) => { + bot.sendMessage(msg.chat.id, message4, { + reply_markup: { + remove_keyboard: true + } + }) + .catch(error => console.error('WARN: Message cannot be sent: ', error)); +}); + }