elif m.text == "Погода":
def pogoda():
try:
place = m.text
observation = mgr.weather_at_place(place)
w = observation.weather
temp = int((w.temperature('celsius')["temp"]))
weath = w.detailed_status
answer = "В географическом объекте " + m.text + " сейчас " + weath + \
". Температура " + str(temp) + "℃."
bot.send_message(m.chat.id, answer)
except BaseException:
error = "Указано неверное название географического объекта."
bot.send_message(m.chat.id, error)
return
def p1():
mesg = bot.send_message(m.chat.id, "Напиши мне название географического объекта")
bot.register_next_step_handler(mesg, pogoda)
p1()