(node:9352) UnhandledPromiseRejectionWarning: Error: play(ncs) encountered:
Error parsing info: Unable to retrieve video metadata
at getWatchPage (D:\Programming\Projects\seconda-ds\BotGenerale\javascript-version\node_modules\ytdl-core\lib\info.js:77:13)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async exports.getBasicInfo (D:\Programming\Projects\seconda-ds\BotGenerale\javascript-version\node_modules\ytdl-core\lib\info.js:86:22)
at async Map.getOrSet (D:\Programming\Projects\seconda-ds\BotGenerale\javascript-version\node_modules\ytdl-core\lib\cache.js:24:19)
at async exports.getInfo (D:\Programming\Projects\seconda-ds\BotGenerale\javascript-version\node_modules\ytdl-core\lib\info.js:210:14)
at async Map.getOrSet (D:\Programming\Projects\seconda-ds\BotGenerale\javascript-version\node_modules\ytdl-core\lib\cache.js:24:19)
at async DisTube._resolveSong (D:\Programming\Projects\seconda-ds\BotGenerale\javascript-version\node_modules\distube\src\DisTube.js:192:55)
at async DisTube.play (D:\Programming\Projects\seconda-ds\BotGenerale\javascript-version\node_modules\distube\src\DisTube.js:243:44)
(node:9352) 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)`
const Discord = require("discord.js");
const bot = new Discord.Client();
bot.distube = new DisTube(bot, { searchSongs: false, emitNewSongOnly: true });
const distube = require("distube");
module.exports = {
name: "play",
desc: "Play a song by title or url",
args: true,
aliases: ["p"],
usage: "play [title]",
async execute(bot, message, args) {
const string = args.join(" ");
try {
bot.distube.play(message, string);
} catch (err) {
message.channel.send(err.message);
}
},
};
"dependencies": {
"@discordjs/opus": "^0.3.3",
"discord.js": "^12.4.1",
"distube": "^2.8.8",
"dotenv": "^8.2.0",
"ffmpeg": "0.0.4",
"ffmpeg-static": "^4.2.7",
"fluent-ffmpeg": "^2.1.2",
"node-fetch": "^2.6.1",
"youtube-dl": "^3.1.0",
"yt-search": "^2.3.3",
"ytdl-core": "^4.0.0"
},