Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

524
Views
Detener comando de bot de Telegram

Estoy escribiendo el bot de Telegram usando node.js y telegraf. Me encontré con la pregunta de cómo hacer el comando /stop para que el usuario no pueda ingresar mensajes hasta que presione el botón de reinicio en la parte inferior. Traté de usar bot.stop() y bot.leaveChat(), pero eso no funciona; Mi código ahora:

 const stop = async ctx => { ctx.reply('Your account was deleted and all subscriptions was cancelled') await CurrencyController.deleteUserCurrencies(ctx) //deletes user's subscriptions from database await UserController.deleteUser(ctx) //deletes user from database bot.stop() //doesn't work correctly }; bot.command('stop', async ctx => await stop(ctx))

Ahora, el resultado del código es este , como puede ver, el bot no se detuvo para el usuario, solo se detuvo en node.js, por lo que necesito reiniciarlo con la terminal.

Necesito ese resultado de la función, se puede hacer con las manos cuando presiona detener y bloquear el bot en su perfil

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!