L
L
Lynatik0012020-07-03 20:20:24
JavaScript
Lynatik001, 2020-07-03 20:20:24

telegraph bot. Deleting a message?

I have a menu in the telegram, I want that when I switch to another menu (by selecting some button from this menu), this menu will be deleted, and a new one will appear instead of it.
Here we come to the very removal. I have a text above and a menu with buttons that goes as one message, there is also a picture that goes separately as another message. Store somewhere in the warehouse, ID messages pictures, I think the height of idiocy? Well, at least as it seems to me, in the form of an unnecessary variable in the main file. (unless in some local storage)

Duck, what is the essence of the issue, only the last message is deleted from me, but how to specify, delete the picture as well. like .previewmassage.deleteMessage() ?
Or maybe I'm here to build bicycles, and is there any implementation of menus with the norms?

bot.start(async (ctx) => {
  await ctx.replyWithPhoto({ source: './img/headerMenu.jpg' });
  await ctx.reply(`*${ctx.from.first_name}*. Добро пожаловать m!`, frontMenu(...arrayOfLabel));
});

bot.action('goUserMenu', (ctx) => {
  ctx.scene.enter('mainMenu');
  ctx.deleteMessage(message_id);
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question