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

Items must either specify an ID or the 'mine' parameter. #155

Closed
Freddson opened this issue Jul 9, 2020 · 2 comments
Closed

Items must either specify an ID or the 'mine' parameter. #155

Freddson opened this issue Jul 9, 2020 · 2 comments
Labels
invalid This doesn't seem right

Comments

@Freddson
Copy link

Freddson commented Jul 9, 2020

When I try to use popyt with my discord bot, this error shows up:
(node:14684) UnhandledPromiseRejectionWarning: Items must either specify an ID or the 'mine' parameter. (node:14684) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:14684) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I don't know why is this happening, everything should be working.
The code is:
const Discord = require("discord.js"); const { YouTube } = require('popyt'); const prefix = "~" const youtube = new YouTube('<token here>'); module.exports.run = async (bot, msg, args) => { const argums = msg.content.slice(prefix.length).split(' '); if (!argums.length) { return msg.channel.send(You didn't provide any arguments, ${msg.author}!); } else { const video = await youtube.getVideo(argums) msg.channel.send(video); } }

@brandonbothell
Copy link
Owner

The ID must be a string, not an array. Use argums[0] in the youtube.getVideo() call.

@Freddson
Copy link
Author

Freddson commented Jul 9, 2020

Thanks!

@brandonbothell brandonbothell added the invalid This doesn't seem right label Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants