Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

335
Vistas
Using a Telegram Bot, can a user trigger another user session of the bot?

I have a big problem. I'm looking like a day to find a solution.

I created a Telegram Bot with the user sessions.

I need a user from his session to be able to update another user's session.

I have already tried to use a sendMessage from the session of the first user which goes to send a message to the session of the second user. But I can't handle this message because, as I've seen, the bot.on() method only handle the message from the user, not from himself.

Any idea?

UPDATE 1: Ok I think I have to give you more information.

There are 2 users. The 2nd user has a button. With the click of this button I want to run some logic on the session of the first user. At the moment with the click of the button I'm sending a msg in the session of the first user, but I can't trigger any logic.

Here the method inside the command triggered by clicking the button of the 2nd user:

bot.command('leave', async (ctx: MyContext)=>{
  try{
    await ServiceHelper.updateSession(ctx.session.chatId!, "");
    await ctx.api.sendMessage(ctx.session.chatId!, "The user left the conversation 🧐", {reply_markup:{resize_keyboard: true, one_time_keyboard: true, keyboard: MenuChat.chatLeftMenu.build()} });
    ctx.session={
      ...ctx.session,
      chatId: "",
      step: "startMenu"
    }
    await MsgHandlerStart.managerStart(ctx);
  }
  catch(error){
    await ctx.answerCallbackQuery({text: ctx.i18n.t("answer-callback.wrong-command")});      
  }
});
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda