diff --git a/garfpy/weather.py b/garfpy/weather.py index f3ed5b9..27fab87 100644 --- a/garfpy/weather.py +++ b/garfpy/weather.py @@ -1,6 +1,7 @@ +import re +import config import discord import aiohttp -import config from garfpy import logger @@ -198,9 +199,7 @@ class WeatherAPI: return embed async def weather(self, ctx, location): - location = "".join( - char for char in location if char.isalpha() or char.isspace() - ) + location = re.sub(r"[^a-zA-Z\s]", "", location) weather_data = await self.get_weather(ctx, location) if weather_data: embed = self.weather_embed(weather_data)