weather regex
All checks were successful
Garfbot CI/CD Deployment / Deploy (push) Successful in 15s

This commit is contained in:
2025-06-08 13:18:26 -05:00
parent 9a68c72d89
commit 9dd24bd322

View File

@ -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)