if (command === 'fetar') {
var deadline = new Date("apr 19, 2020 00:00:00").getTime();
var currentDate = new Date().getTime();
var remainingTime = deadline - currentDate;
var days = Math.floor(remainingTime / (1000 * 60 * 60 * 24));
var hours = Math.floor((remainingTime %(1000 * 60 * 60 * 24))/(1000 * 60 * 60));
var minutes = Math.floor((remainingTime % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((remainingTime % (1000 * 60)) / 1000);
giphy.search('gifs', {"q": "food"})
.then((response) => {
console.log(response);
var totalResponses = response.data.length;
var responseIndex = Math.floor((Math.random() * 10) + 1) % totalResponses;
var responseFinal = response.data[responseIndex];
message.channel.send(' **E N D O F L E N T** ');
message.channel.send(`**${days}** days, **${hours}** hrs, **${minutes}** mins, **${seconds}** secs`, {
files: [responseFinal.images.fixed_height.url]})
})
.catch (() => {
console.log('Ya messed up again...')
})
}
尝试使用此代码但无济于事,它直接进入我的错误捕获并且不生成 gif。我试图控制台记录导致此问题的步骤,但没有显示任何内容。