Skip to content
This repository was archived by the owner on Sep 29, 2021. It is now read-only.

Commit 158c057

Browse files
MrMissxMoveAngel
authored andcommitted
lastfm: handle track not found
Co-authored-by: Mr.Miss <[email protected]> Signed-off-by: MoveAngel <[email protected]>
1 parent 6c872a1 commit 158c057

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

userbot/modules/lastfm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ async def last_fm(lastFM):
8282
for i, track in enumerate(recent):
8383
print(i)
8484
printable = await artist_and_song(track)
85-
tags = await gettags(track)
85+
try:
86+
tags = await gettags(track)
87+
except WSError as err:
88+
return await lastFM.edit(err)
8689
rectrack = parse.quote(str(printable))
8790
rectrack = sub("^", "https://open.spotify.com/search/", rectrack)
8891
output += f"• [{printable}]({rectrack})\n"

0 commit comments

Comments
 (0)