import pyowm
from pyowm.owm import OWM
import pyowm
import telebot
owm = OWM("dcb0ee4d2cee80b9354a88ffe34598ca")
bot = telebot.TeleBot("5544470894:AAHPM39WFclfLcheDBC0_URs6bpYDVfsodg")
@bot.message_handler(content_types=['text'])
def send_echo(message):
observation = owm.weather_manager().weather_at_place(messege.text)
w = observation.weather
temp = w.temperature('celsius')
answer = 'В городе ' + messege.text + "сейчас " + w.detailed_status() + "\n"
answer = answer + "Температура сейчас в районе " + str(temp) + "\n\n"
if temp == 10:
answer = answer + ("сейчас ппц как холодно")
elif temp == 14:
answer = answer + ("оденься потеплее")
else:
answer = answer + ("температура норм ")
bot.send_messege(message.chat.id, answer)
bot.polling(none_stop = True)