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

223
Views
call back query send duplicate messages node-telegram-bot-api

Whenever inline button clicked by user call back query send duplicate messages so what type of changes I need to do to bot not send duplicate messages.

      var keyboard = [];
      movieRatingList.map((movie, idx) => {
        var movieRating = Math.round(movie.rating * 10) / 10;
        if (movieRating == bestRating) {
          var firstName = movieList[idx].firstName;
          keyboard.push([{ text: firstName, callback_data: idx }]);
        }
      });

      bot.sendMessage(userChatId, userText, {
        reply_markup: JSON.stringify({
          resize_keyboard: true,
          inline_keyboard: keyboard,
        }),
      });

      bot.on("callback_query", (callBackData) => {
        var idx = Number(callBackData.data);

        var fileID = movieList[idx].file_id;
        var firstName = movieList[idx].firstName;
        console.log(fileID);
        console.log(firstName);
        bot.sendDocument(userChatId, fileID, { caption: firstName });
        
      });
about 4 years ago · Juan Pablo Isaza
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!