我正在尝试使用discord.js
&创建一个音乐机器人ytdl-core
。我想在使用名为!nowplaying
. 但是,我不确定我是如何获得时间的。我的代码:
//bot.queue is a collection, and contains some attributes, like songs (array) and connection (ytdl)
let queue = bot.queue.get(message.guild.id);
const time = queue.connection.streamTime; //Doesn't work!
//Convert time here, then output
message.channel.send(`Now Playing - ${queue.songs[0].title} - ${time}`);
我尝试过使用queue.connection.streamTime
, 和其他方法,但它们没有奏效