Skip to content

Commit

Permalink
Add error handling for unsupported external links (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
p-hennessy authored Dec 10, 2022
1 parent b9dae62 commit 165c085
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cogs/maplist.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ async def add_map(self, ctx, message, link, notes="", old_map=None):
link = link[0]

# Find map download in link
link = await self.parse_link(link)
try:
link = await self.parse_link(link)
except IndexError:
await message.edit(content=f"{error} External Links not currently supported. Upload your map directly to the website.")
return

if not link:
await message.edit(content=f"{error} No valid link found.")
return
Expand Down

0 comments on commit 165c085

Please sign in to comment.