From de3657d4febbf1319d6ee986ac5113740089b2d2 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sat, 15 Jul 2023 12:36:07 +0200 Subject: [PATCH] fix: Handle another player error from YouTube. --- commands/play.js | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/commands/play.js b/commands/play.js index c585786..b60b7b6 100644 --- a/commands/play.js +++ b/commands/play.js @@ -107,13 +107,16 @@ module.exports = { } if ( - error.type === 'TypeError' && - (error.message.includes( - 'Cannot read properties of null (reading \'createStream\')' - ) || - error.message.includes( - 'Failed to fetch resources for ytdl streaming' - )) + (error.type === 'TypeError' && + (error.message.includes( + 'Cannot read properties of null (reading \'createStream\')' + ) || + error.message.includes( + 'Failed to fetch resources for ytdl streaming' + ))) || + error.message.includes( + 'Could not extract stream for this track' + ) ) { return await interaction.editReply({ embeds: [ @@ -168,7 +171,9 @@ module.exports = { embeds: [ new EmbedBuilder() .setAuthor({ - name: interaction.member.nickname || interaction.user.username, + name: + interaction.member.nickname || + interaction.user.username, iconURL: interaction.user.avatarURL() }) .setDescription( @@ -191,7 +196,10 @@ module.exports = { embeds: [ new EmbedBuilder() .setAuthor({ - name: interaction.member.nickname || interaction.member.nickname || interaction.user.username, + name: + interaction.member.nickname || + interaction.member.nickname || + interaction.user.username, iconURL: interaction.user.avatarURL() }) .setDescription( @@ -207,7 +215,9 @@ module.exports = { embeds: [ new EmbedBuilder() .setAuthor({ - name: interaction.member.nickname || interaction.user.username, + name: + interaction.member.nickname || + interaction.user.username, iconURL: interaction.user.avatarURL() }) .setDescription(