使用 "ms "包的时间限制

问题描述 投票:-2回答:1
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 });

javascript time bots discord discord.js
1个回答
0
投票

解决办法是:"ms(giveawayDuration.content) > ms('15d')"

© www.soinside.com 2019 - 2024. All rights reserved.