embed.messages: fix syntax, add docstring

This commit is contained in:
Luna 2019-03-19 00:06:52 -03:00
parent 404783534c
commit 13720904bd
1 changed files with 2 additions and 1 deletions

View File

@ -86,11 +86,12 @@ async def _update_and_dispatch(payload, new_embeds, storage, dispatcher):
def is_media_url(url: str) -> bool:
"""Return if the given URL is a media url."""
parsed = urllib.parse.urlparse(url)
path = Path(parsed.path)
extension = path.suffix.lstrip('.')
return extension in MEDIA_EXTENSIONS:
return extension in MEDIA_EXTENSIONS
async def insert_mp_embed(parsed, config, session):