fix !vreme for spaces in cities

This commit is contained in:
fram3d 2024-03-04 11:45:57 +01:00
parent 690239bb86
commit d52b4ac5e5
Signed by: fram3d
GPG Key ID: 938920E709EEA32A

View File

@ -51,7 +51,7 @@ def getDmzTasks(url):
def get_weather(city:str) -> str: def get_weather(city:str) -> str:
url = f"https://wttr.in/{city}?format=3" url = f"https://wttr.in/{city}?format=3"
if not city.isalpha(): if not city.replace(" ","").isalpha():
return "no such city" return "no such city"
resp = requests.get(url) resp = requests.get(url)
return resp.content.decode("utf-8").strip() return resp.content.decode("utf-8").strip()