0

I wanted to do the multiple selections for the grammY telegram bot but it seems not working

async function generatePayslipSelection(conversation: MyConversation, ctx: MyContext) {
    await ctx.reply(`Payslip Type`, {
        reply_markup: buildPayslipSelection()
    });

    // bot.editMessageReplyMarkup({
    //     reply_markup: buildPayslipSelection()
    // }, {
    //     chat_id: chat_id,
    //     message_id: msg_id
    // });
    console.log(ctx);
    bot.editMessageReplyMarkup(ctx.update.update_id, ctx.update.message.message_id, buildPayslipSelection())
}

I need to add in emoji while pressing button and remove an emoji while pressing button twice

export function buildPayslipSelection() {
    let inline_keyboard = new InlineKeyboard();
    let payslip = 0;
    for (const key in PayslipType) {
        const value = PayslipType[key];
        payslip++;

        inline_keyboard.text(value, value);

        // Move to next row when current row is filled up by 2 features
        if (payslip % 2 == 0) {
            inline_keyboard.row();
        }
    }
    return inline_keyboard;
}

the final data will stores in an array

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.