Merge pull request #3 from PacketParker/dev
Fix 404 errors when searching for lyrics
This commit is contained in:
commit
727130dc1a
@ -32,6 +32,10 @@ class Lyrics(commands.Cog):
|
|||||||
)
|
)
|
||||||
return await interaction.response.send_message(embed=embed, ephemeral=True)
|
return await interaction.response.send_message(embed=embed, ephemeral=True)
|
||||||
|
|
||||||
|
# Defer the interaction to avoid getting 404 Not Found errors
|
||||||
|
# if fetching the lyrics takes a long time
|
||||||
|
await interaction.response.defer(ephemeral=True)
|
||||||
|
|
||||||
# Search for the songs lyrics with Genius
|
# Search for the songs lyrics with Genius
|
||||||
song = self.bot.genius.search_song(player.current.title, player.current.author)
|
song = self.bot.genius.search_song(player.current.title, player.current.author)
|
||||||
|
|
||||||
@ -49,8 +53,7 @@ class Lyrics(commands.Cog):
|
|||||||
)
|
)
|
||||||
+ " UTC"
|
+ " UTC"
|
||||||
)
|
)
|
||||||
|
return await interaction.edit_original_response(embed=embed)
|
||||||
return await interaction.response.send_message(embed=embed, ephemeral=True)
|
|
||||||
|
|
||||||
# Remove unwanted text
|
# Remove unwanted text
|
||||||
lyrics = song.lyrics
|
lyrics = song.lyrics
|
||||||
@ -70,8 +73,7 @@ class Lyrics(commands.Cog):
|
|||||||
)
|
)
|
||||||
+ " UTC"
|
+ " UTC"
|
||||||
)
|
)
|
||||||
|
await interaction.edit_original_response(embed=embed)
|
||||||
await interaction.response.send_message(embed=embed, ephemeral=True)
|
|
||||||
|
|
||||||
|
|
||||||
async def setup(bot):
|
async def setup(bot):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user