mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
Merge pull request #103 from mariusbegby/handle-youtube-warnings
Handle youtube warnings
This commit is contained in:
1 file changed
+18
@@ -98,6 +98,9 @@ module.exports = {
|
|||||||
logger.debug(`[Shard ${interaction.guild.shardId}] player.play() successful. Query: ${query}.`);
|
logger.debug(`[Shard ${interaction.guild.shardId}] player.play() successful. Query: ${query}.`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.message.includes('Sign in to confirm your age')) {
|
if (error.message.includes('Sign in to confirm your age')) {
|
||||||
|
logger.debug(
|
||||||
|
`[Shard ${interaction.guild.shardId}] Found track but failed to retrieve audio due to age confirmation warning.`
|
||||||
|
);
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
@@ -109,6 +112,21 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (error.message.includes('The following content may contain graphic or violent imagery')) {
|
||||||
|
logger.debug(
|
||||||
|
`[Shard ${interaction.guild.shardId}] Found track but failed to retrieve audio due to graphic or violent imagery warning.`
|
||||||
|
);
|
||||||
|
return await interaction.editReply({
|
||||||
|
embeds: [
|
||||||
|
new EmbedBuilder()
|
||||||
|
.setDescription(
|
||||||
|
`**${embedOptions.icons.warning} Cannot retrieve audio for track**\nThis audio source cannot be played as the video source has a warning for graphic or violent imagery. It requires a manual confirmation to to play the video, and because of this I am unable to extract the audio for this source.\n\n_If you think this message is incorrect, please submit a bug report in the **[support server](${botOptions.serverInviteUrl})**._`
|
||||||
|
)
|
||||||
|
.setColor(embedOptions.colors.warning)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(error.type === 'TypeError' &&
|
(error.type === 'TypeError' &&
|
||||||
(error.message.includes('Cannot read properties of null (reading \'createStream\')') ||
|
(error.message.includes('Cannot read properties of null (reading \'createStream\')') ||
|
||||||
|
|||||||
Reference in new issue
Block a user