【发布时间】:2020-09-18 17:17:55
【问题描述】:
let giveawayDuration = response2.first();
// Limit duration to max 15d
if (giveawayDuration > ms('15d')) {
const l1 = new Discord.MessageEmbed()
.setColor('#ff0000')
.setDescription(❌ Your duration cannot be more than 15 Days!)
return message.channel.send(l1);
}
它为什么会阻止每个持续时间,有人知道为什么/我做错了什么?
const ms = require('ms');
const response2 = await message.channel.awaitMessages(m => m.author.id === message.author.id, { max: 1 });
【问题讨论】:
-
您需要显示
ms()函数的定义以及response2是什么。 -
编辑它,ms是一个非常非常流行的包它只是为了你不必写129000000
-
但我编辑了它
-
response2.first()真的返回一个数字吗? -
所以
giveawayDuration是“10d”而ms('15d')是129000000,所以你的比较是"10d" > 129000000?
标签: javascript time bots discord discord.js