This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
|
import re
|
||||||
|
import config
|
||||||
import discord
|
import discord
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import config
|
|
||||||
from garfpy import logger
|
from garfpy import logger
|
||||||
|
|
||||||
|
|
||||||
@ -198,9 +199,7 @@ class WeatherAPI:
|
|||||||
return embed
|
return embed
|
||||||
|
|
||||||
async def weather(self, ctx, location):
|
async def weather(self, ctx, location):
|
||||||
location = "".join(
|
location = re.sub(r"[^a-zA-Z\s]", "", location)
|
||||||
char for char in location if char.isalpha() or char.isspace()
|
|
||||||
)
|
|
||||||
weather_data = await self.get_weather(ctx, location)
|
weather_data = await self.get_weather(ctx, location)
|
||||||
if weather_data:
|
if weather_data:
|
||||||
embed = self.weather_embed(weather_data)
|
embed = self.weather_embed(weather_data)
|
||||||
|
Reference in New Issue
Block a user