Ad

Time Limit With The "ms" Package

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);
            }

It whyever blocks every duration, someone knows why/what I have done wrong?

const ms = require('ms');

const response2 = await message.channel.awaitMessages(m => m.author.id === message.author.id, { max: 1 });

Ad

Answer

The solution is to make it : "ms(giveawayDuration.content) > ms('15d')"

Ad
source: stackoverflow.com
Ad