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

227
Views
find nearest location using node js and mysql telegram bot

I was trying to do a telegram bot that finds a nearby location using node js and mysql. but after finding users coordinate(latitude,Longitude) in mycase (mylat,mylng). i cant take the values out of the parenthesis. here is the index.js N.B all the configurations are done.

bot.on('location', (msg) => {   
const mylat=msg.location.latitude;
const mylng=msg.location.longitude;

console.log(msg.location.latitude);
console.log(msg.location.longitude);
getNearestLocation(Latitude,longitude).then(res=>{
  bot.sendMessage(msg.chat.id,res)
  bot.sendLocation(msg.chat.id, Latitude,longitude)

})  
  }); 
console.log(mylat); // i can't print here

The variables doesn't work out of bot.on('location'.......... parenthesis

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!