Answer the question
In order to leave comments, you need to log in
How to copy the geolocation in telegram (which was sent to the bot) as a link to Google Maps / geolocation?
import telebot
from telebot import types
bot = telebot.TeleBot('5119846546:AAFxQuiyo1n0xeaxQtSGyq52JhC5bkMtP9k')
@bot.message_handler(commands=["start"])
def start(message): #Keyboard
with button to request location
chatid = message.chat.id
keyboard = types.ReplyKeyboardMarkup(row_width=1, resize_keyboard=True)
button_geo = types.KeyboardButton(text="Send Geolocation", request_location=True)
keyboard.add(button_geo)
bot.send_message(chatid, "Need help?", reply_markup =keyboard) #Get
location
@bot.message_handler(content_types=['location'])
def location(message):
if message.location is not None:
print(message.location)
bot.send_message('chat_id',message.location) #send this location to a specific contact
# print(message)
# def cmd_start(message):
# bot.send_message(message.from_user.id, 'Hello'
bot.polling() input
()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question