Closed abhi3700 closed 5 years ago
I am using this in a callback
import botogram @bot.command("sendinfo") def sendinfo_command(chat, message, args): """User has to click a button for giving information - Username, Datetime, Location""" btns = botogram.Buttons() btns[0].callback("Username", "username") # button - Username btns[1].callback("Location", "location") # button - Location chat.send("Please, select one of the buttons popping below.", attach= btns) @bot.callback("location") def location_callback(query, chat, message): loc = query.sender.location lat = loc.latitude lng = loc.longitude chat.send(str(lat) + " & " + str(lng)) # test query.notify("{latitude} & {longitude} saved.".format(latitude=lat, longitude=lng)) if __name__ == "__main__": bot.run()
When I am pressing location button, then there is no message (i.e. location i.e. lat, lng) sent from Bot in the chat.
location
Can anyone (@MarcoBuster) please help me with this? I followed the similar technique for callback from my previous issue
@abhi3700 You can't get the user's location from a callback query. The user must send its location via the attachments menu.
Ok thanks!
I am using this in a callback
When I am pressing
location
button, then there is no message (i.e. location i.e. lat, lng) sent from Bot in the chat.Can anyone (@MarcoBuster) please help me with this? I followed the similar technique for callback from my previous issue