I think that this library should be able to interpret URLs of the domain youtu.be, which are the URLs obtained through the Share button of the YouTube app.
When you try to use one of those URLs, you get the following error:
Error: not a known youtube link
at AsyncFunction.main.getPlaylistID (/home/user/bot/node_modules/ytpl/lib/main.js:207:46)
at module.exports (/home/user/bot/node_modules/ytpl/lib/main.js:13:30)
at addPlaylist (/home/user/bot/commands/music/play.js:254:40)
at Object.exports.run (/home/user/bot/commands/music/play.js:349:21)
at Object.exports.run (/home/user/bot/events/message.js:169:23)
at Client.<anonymous> (/home/user/bot/index.js:82:31)
at Client.emit (node:events:394:28)
at MessageCreateAction.handle (/home/user/bot/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/user/bot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/user/bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
EDIT: It would be a good idea to use regular expressions to solve the problem:
I think that this library should be able to interpret URLs of the domain
youtu.be
, which are the URLs obtained through the Share button of the YouTube app.When you try to use one of those URLs, you get the following error:
EDIT: It would be a good idea to use regular expressions to solve the problem: