Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting ValidationError using play playlist slashCommand #13

Open
fffonceca opened this issue Jan 25, 2023 · 0 comments
Open

Getting ValidationError using play playlist slashCommand #13

fffonceca opened this issue Jan 25, 2023 · 0 comments

Comments

@fffonceca
Copy link

Hi!

Just starting to use this code. I had some issues with play playlist. In play.js there is this line of code

embed
    .setDescription(`**${result.tracks.length} songs from [${playlist.title}](${playlist.url})** have been added to the Queue`)
    .setThumbnail(playlist.thumbnail)

The error occurs when .setThumbnail receives playlist.thumbnail. The whole error log is below:

    return Result.err(new CombinedError(errors));
                      ^

CombinedError: Received one or more errors
    at UnionValidator.handle (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\node_modules\@sapphire\shapeshift\dist\index.js:1088:23)
    at UnionValidator.parse (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\node_modules\@sapphire\shapeshift\dist\index.js:201:88)
    at EmbedBuilder.setThumbnail (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\node_modules\@discordjs\builders\dist\index.js:257:23)
    at Object.run (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\slash\play.js:67:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleCommand (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\index.js:70:13) {
  errors: [
    ValidationError: Expected undefined or null
        at NullishValidator.handle (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\node_modules\@sapphire\shapeshift\dist\index.js:748:79)
        at NullishValidator.run (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\node_modules\@sapphire\shapeshift\dist\index.js:187:23)
        at UnionValidator.handle (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\node_modules\@sapphire\shapeshift\dist\index.js:1083:32)
        at UnionValidator.parse (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\node_modules\@sapphire\shapeshift\dist\index.js:201:88)
        at EmbedBuilder.setThumbnail (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\node_modules\@discordjs\builders\dist\index.js:257:23)
        at Object.run (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\slash\play.js:67:18)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async handleCommand (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\index.js:70:13) {
      validator: 's.nullish',
      given: Thumbnail {
        id: null,
        width: 336,
        height: 188,
        url: 'https://i.ytimg.com/vi/Yd8kUoB72xU/hqdefault.jpg?sqp=-oaymwEXCNACELwBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLDqzu6hKMS8ScZnwypHbxwv6WF2Aw'
      }
    },
    ValidationError: Expected a string primitive
        at StringValidator.handle (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\node_modules\@sapphire\shapeshift\dist\index.js:1705:70)
        at StringValidator.run (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\node_modules\@sapphire\shapeshift\dist\index.js:187:23)
        at UnionValidator.parse (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\node_modules\@sapphire\shapeshift\dist\index.js:201:88)
        at Object.run (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\slash\play.js:67:18)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async handleCommand (C:\Users\focax\Documents\Repos\Practica\Proyecto_Fokabot\index.js:70:13) {
      validator: 's.string',
      given: Thumbnail {
        id: null,
        width: 336,
        height: 188,
        url: 'https://i.ytimg.com/vi/Yd8kUoB72xU/hqdefault.jpg?sqp=-oaymwEXCNACELwBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLDqzu6hKMS8ScZnwypHbxwv6WF2Aw'
      }
    }
  ]
}

I avoided this issue by just deleting that line, but i need a solution of the setThumbnail part. What gives??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant