Untitled

mail@pastecode.io avatar
unknown
javascript
2 years ago
1.0 kB
1
Indexable
Never
scene one:
 await ctx.telegram.sendMessage(process.env.logs_chat, `re: ${ctx.message.text}`, {
            ...Markup.inlineKeyboard(
                [
                    [
                        Markup.button.callback('addmoney', `log_${data.id}_addmoney`)
                    ], 
                    [Markup.button.url('write', `t.me/${ctx.from.username}`)]
                ]
            )
handle:
bot.action(/^log_(\d+)_(addmoney)$/, async (ctx) => await ctx.scene.enter('success'))

scene two:

const { Scenes, Markup } = require('telegraf')


const success = new Scenes.WizardScene('success', async (ctx) => {

        ctx.wizard.state.data = {}
        await ctx.replyWithHTML('<b>Enter amount [EURO]</b>', {
            ...Markup.inlineKeyboard(
                [
                    Markup.button.callback('Cancel', 'cancel')
                ]
                    )
                }
            )
            return ctx.wizard.next()    

}, async (ctx) => {
 await ctx.reply('I'm here.');
}
)
module.exports = success