Hi. I have this problem: I have 2 scene.enter
handlers, in both I save the bot message, but one handler saves the message and the other doesn't.
scene.enter(async (ctx) => {
const msg = await ctx.reply("login");
ctx.scene.state.editMsg = { chatId: msg.chat.id, messageId: msg.message_id };
});
scene.enter(async (ctx) => {
const msg = await ctx.replyWithPhoto(
{ source: `${process.env.rootDir}/assets/img/settings.png` },
Extra.load({ caption: "Settings" })
.markdown()
.markup((m) =>
m.inlineKeyboard([
[m.callbackButton("Profile", "profile"), m.callbackButton("Social", "social")],
[m.callbackButton("Wallet", "wallet"), m.callbackButton("Back", "back")],
])
)
);
ctx.scene.state.delMsg = { chatId: msg.chat.id, messageId: msg.message_id };
});
But this code doesn't save the message.
What could be the problem?
node: v12.16.1
npm: v6.13.4