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

275
Views
responder desde el chat grupal (bot de telegram - soporte) (NODE JS)

ayuda, por favor, estoy escribiendo un bot de Telegram para recibir comentarios, en este momento funciona en un chat privado (es decir, el usuario escribe al bot; respondo al bot a través de una respuesta y el usuario recibe un SMS del bot), pero no lo hace. trabajar en el chat grupal (en un grupo puedo ver los mensajes del usuario, pero no puedo responder al usuario a través de la respuesta). es necesario que cualquier usuario del grupo pueda responder al mensaje del usuario

 const bot = new Telegraf(token, {}); let replyText = { 'helloAdmin': '...', 'helloUser': '...', 'replyWrong': '....' }; let isAdmin = userId => { return userId === admin; }; let forwardToAdmin = ctx => { if (isAdmin(ctx.message.from.id)) { ctx.reply(replyText.replyWrong); } else { ctx.forwardMessage(admin, ctx.from.id, ctx.message.id); } }; bot.start(ctx => { ctx.reply(isAdmin(ctx.message.from.id) ? replyText.helloAdmin : replyText.helloUser); }); bot.on('message', ctx => { if (ctx.message.reply_to_message && ctx.message.reply_to_message.forward_from && isAdmin(ctx.message.from.id)) { ctx.telegram.sendCopy(ctx.message.reply_to_message.forward_from.id, ctx.message); } else { forwardToAdmin(ctx); } }); bot.launch();
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

hay un método getChatAdministrators ( https://core.telegram.org/bots/api#getchatadministrators ), supongo que puede usarlo para obtener administradores del grupo y verificar si uno de ellos responde. En ese caso, reenviarlo al usuario.

about 4 years ago · Juan Pablo Isaza Report
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!